py4dstem / py4DSTEM

GNU General Public License v3.0
201 stars 136 forks source link

show_DP_grid does not generate correct ax #125

Closed terryxie007 closed 1 year ago

terryxie007 commented 4 years ago
ryy,rxx = np.meshgrid(np.arange(ry0,ry0+yL),np.arange(rx0,rx0+xL))
fig,axs = plt.subplots(xL,yL,figsize=(yL*axsize[0],xL*axsize[1]))
for rxi in range(xL):
    for ryi in range(yL):
        ax = axs[rxi,ryi]
        rx,ry = rxx[rxi,ryi],ryy[rxi,ryi]
        dp = datacube.data[rx,ry,:,:]
        _,_ = show(dp,ax=(fig,ax),returnfig=True,**kwargs)
plt.tight_layout()
if not returnfig:
    plt.show()
    return
else:
    return fig,ax

Maybe here it should be return fig, axs?

bsavitzky commented 1 year ago

Hey @terryxie007 - you're right! Should have been axs. That's fixed on the dev branch now, the fix will be released with v14.0