GridSpec¶
- class GridSpec(nrows=1, ncols=1, **kwargs)[source]¶
Bases:
matplotlib.gridspec.GridSpecA
GridSpecsubclass that permits variable spacing between successive rows and columns and hides “panel slots” from indexing.- Parameters
nrows, ncols (
int, optional) – The number of rows and columns on the subplot grid.left, right, top, bottom (
floatorstr, optional) – The fixed space between the subplots and the figure edge. Default isNone. %(units.em)s IfNone, the space is determined automatically based on the font size and axis sharing settings. Ifrc['subplots.tight']isTrue, the space is determined by the tight layout algorithm.wequal, hequal, equal (
bool, optional) – Whether to make the tight layout algorithm apply equal spacing between columns, rows, or both. Default isFalse. Ignored ifrc.tightisFalse.outerpad (
floatorstr, optional) – The tight layout padding around edge of figure. Units are interpreted byunits. Default isrc['subplots.outerpad']=0.5. %(units.em)sinnerpad (
floatorstr, optional) – The scalar tight layout padding between columns and rows. Synonymous withpad. Default isrc['subplots.innerpad']=1.0. %(units.em)spanelpad (
floatorstr, optional) – The tight layout padding between subplots and axes panels and between “stacked” panels. Default isrc['subplots.panelpad']=0.5. %(units.em)swequal, hequal, equal (
bool, optional) – Whether to make the tight layout algorithm apply equal spacing between columns, rows, or both. Default isFalse. Ignored ifrc.tightisFalse.outerpad (
floatorstr, optional) – The tight layout padding around edge of figure. Units are interpreted byunits. Default isrc['subplots.outerpad']=0.5. %(units.em)sinnerpad (
floatorstr, optional) – The scalar tight layout padding between columns and rows. Synonymous withpad. Default isrc['subplots.innerpad']=1.0. %(units.em)spanelpad (
floatorstr, optional) – The tight layout padding between subplots and axes panels and between “stacked” panels. Default isrc['subplots.panelpad']=0.5. %(units.em)s
Note
Adding axes panels, axes or figure colorbars, and axes or figure legends quietly augments the gridspec geometry by inserting “panel slots”. However subsequently indexing the gridspec with
gs[num]orgs[row, col]will ignore the “panel slots”. This permits adding new subplots by passinggs[num]orgs[row, col]toadd_subploteven in the presence of panels. See__getitem__for details.Attributes Summary
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
The
proplot.figure.Figureinstance uniquely associated with thisGridSpec.partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
The number of columns in the grid.
The number of rows in the grid.
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Methods Summary
__getitem__(key)Get a
SubplotSpec.Return the total number of rows and columns in the grid.
get_grid_positions([figure])Return the subplot grid positions allowing for variable inter-subplot spacing and using physical units for the spacing terms.
Return the number of rows and columns allocated for "panel" subplots and not available with
gridspec[...]indexing.Return the number of rows and columns allocated for "main" subplots and available with
gridspec[...]indexing.update(**kwargs)Update the gridspec with arbitrary initialization keyword arguments and update the subplot positions.