atompy.get_sorted_axes_grid#

atompy.get_sorted_axes_grid(fig=None)[source]#

Get all axes from fig and sort them into a 2D grid.

Only works if all axes of fig are part of one-and-the-same matplotlib.gridspec.GridSpec and if axes are arranged in a 2D grid.

Ignores colormap axes added by add_colorbar().

Parameters:
figmatplotlib.figure.Figure, optional

If None, use last active figure.

Returns:
axes_gridndarray, shape(nrows, ncols)

A 2D numpy array containing the axes of fig.

axes_grid[0, 0] refers to the top-left, axes_grid[nrows-1, ncols-1] to the bottom right corner.