_layout_subplot_panels(npanels, nrow=None, ncol=None, ndefault=5, maxpanels=50)¶
Create space-optimal subplot grid given required number of panels
npanels (int) – Number of required subplot panels in figure
ndefault (int) – Default number of panel columns for grid construction (only relevant if both nrow and ncol are None).
maxpanels (int) – Maximally allowed number of subplot panels for which a grid is constructed
nrow (int) – Number of rows of constructed subplot panel grid
nrow (int) – Number of columns of constructed subplot panel grid
If both nrow and ncol are None, the constructed grid will have the dimension N x ndefault, where N is chosen “optimally”, i.e., the smallest integer that satisfies
ndefault * N >= npanels. Note further, that this is an auxiliary method that is intended purely for internal use. Thus, error-checking is only performed on potentially user-provided inputs (nrow and ncol).
create and prepare figures for Syncopy visualizations
Create grid of default dimensions to hold eight panels
>>> _layout_subplot_panels(8, ndefault=5) (2, 5)
Create a grid that must have 4 rows
>>> _layout_subplot_panels(8, nrow=4) (4, 2)
Create a grid that must have 8 columns
>>> _layout_subplot_panels(8, ncol=8) (1, 8)