plot a large number of axis objects using one command through a loop

后端 未结 3 816
深忆病人
深忆病人 2021-01-23 21:35

Say I have a bunch of ax1,ax2,ax3... and I want to run them through a plotting function:

def plotxy(ax,x,y):
    x = np.array(x)
    y = np.array(y)
    ax.plot(         


        
3条回答
  •  一整个雨季
    2021-01-23 22:17

    you can also use map, x and y being name space variables and axx some iterable over your axes objects:

    x = ...
    y = ...
    
    def plotxy(ax):
        ax.plot(x,y)
    
    map(plotxy,axx)
    

提交回复
热议问题