calamari.style.figure#
- calamari.style.figure(spec, *, width='single', look=None, height_cm=None, nrows=1, ncols=1, **subplots_kwargs)#
Create a journal-sized figure and axes, styled, in one call.
plt.subplotsundercontext(), returning what it returns. The figure keeps its size after the context ends, but artists added later from outside a style context take the session’s rcParams – so build the whole figure inside onecontext()block when mixing helpers with your ownax.plotcalls, or calluse()once.The default height gives every panel
DEFAULT_ASPECT, so a two-across double-column figure is one panel tall;layout='constrained'is on unlesssubplots_kwargssays otherwise, because tick labels at 7 pt on an 8.5 cm figure clip without it.- Parameters:
spec (
str) – As forrc().height_cmis the height of the whole figure.width (
str|float) – As forrc().height_cmis the height of the whole figure.look (
str|None) – As forrc().height_cmis the height of the whole figure.height_cm (
float|None) – As forrc().height_cmis the height of the whole figure.nrows (
int) – Panel grid, forwarded toplt.subplots.ncols (
int) – Panel grid, forwarded toplt.subplots.**subplots_kwargs (
Any) – Forwarded toplt.subplots(sharex=,gridspec_kw=, …).
- Return type:
- Returns:
tuple–(fig, axes)exactly asplt.subplotsreturns them: a singleAxesfor a 1x1 grid, otherwise an array of them.