py4dstem / py4DSTEM

GNU General Public License v3.0
206 stars 141 forks source link

`show` ignores `figsize` when plotting multiple images #598

Open sezelt opened 9 months ago

sezelt commented 9 months ago

Describe the bug When passing a list of images to py4DSTEM.show, the figsize argument is ignored.

To Reproduce

import py4DSTEM
import numpy as np

arr = np.random.rand(128,128)

py4DSTEM.show(arr, figsize=(2,2)) # <-- works
# py4DSTEM.show(arr, figsize=(2, np.nan)) # <-- raises error (as expected)

py4DSTEM.show([arr,arr], figsize=(2,2)) # <-- figsize is not changed
py4DSTEM.show([arr,arr], figsize=(2,np.nan)) # <-- does not raise an error

Expected behavior figsize should control the size of the figure.

Additional context For grid plots, the undocumented keyword argument axsize controls the size of each axis in the figure. At a minimum this should be documented, and ideally there should also be a way to get the overall size of the figure.