gsplot.figure.axes#
Functions
|
Creates and configures a Matplotlib figure with specified parameters. |
- axes(store=False, size=[5, 5], unit='in', mosaic='A', clear=True, ion=False, *args, **kwargs)[source]#
Creates and configures a Matplotlib figure with specified parameters.
This function wraps the AxesHandler class to provide an easy interface for managing Matplotlib figures and their axes. Parameters such as figure size, units, mosaic layouts, and additional configuration options can be specified.
- Parameters:
store (
bool
, optional) – Whether to use a shared storage for axes or figure states (default is False).size (
list
ofint
orfloat
, optional) – The size of the figure in the specified unit (default is [5, 5]).unit (
{"mm", "cm", "in", "pt"}
, optional) – The unit for the figure size. Supported units are “mm”, “cm”, “in”, and “pt” (default is “in”).mosaic (
str
orlist
ofHashableList[_T]
orlist
ofHashableList[Hashable]
, optional) – The mosaic layout for subplots. Can be a string or a list of hashable items (default is “A”).clear (
bool
, optional) – Whether to clear the current figure before creating a new one (default is True).ion (
bool
, optional) – Whether to enable interactive mode for the figure (default is False).*args (
Any
) – Additional positional arguments to pass to Matplotlib’s figure creation methods.**kwargs (
Any
) – Additional keyword arguments to pass to Matplotlib’s figure creation methods.
Notes
This function utilizes the ParamsGetter to retrieve bound parameters and the CreateClassParams class to handle the merging of default, configuration, and passed parameters.
- Returns:
A list of axes in the created figure.
- Return type:
Examples
>>> import gsplot as >>> axs = gs.axes(size=[10, 8], unit="cm", mosaic="AB;CD", ion=True) >>> print(axs) [<Axes: label='A'>, <Axes: label='B'>, <Axes: label='C'>, <Axes: label='D'>]