amep.plot.new#

amep.plot.new(figsize: tuple[float, float] | None = None, facecolor: str = 'white', nrows: int = 1, ncols: int = 1, width_ratios: float | None = None, height_ratios: float | None = None, sharex: bool = False, sharey: bool = False, wspace: float | None = None, hspace: float | None = None, w_pad: float | None = None, h_pad: float | None = None, **kwargs) tuple[Figure, Axes | ndarray]#

Create a new matplotlib.pyplot figure (uses matplotlib.pyplot.subplots).

Parameters:
  • figsize (tuple, optional) – Size of the figure in inches. The default, None, reverts to the default amep or matplotlib figsize.

  • facecolor (str, optional) – Background color of the figure. The default is ‘white’.

  • nrows (int, optional) – Number of rows. The default is 1.

  • ncols (int, optional) – Number of columns. The default is 1.

  • width_ratios (list, optional) – Size ratios of the columns (list of int). The default is None.

  • height_ratios (list, optional) – Size ratios of the rows (list of int). The default is None.

  • sharex (bool or {'none', 'all', 'row', 'col'}, optional) – Share the same x axis. The default is False.

  • sharey (bool or {'none', 'all', 'row', 'col'}, optional) – Share the same y axis. The default is False.

  • wspace (float, optional) – Space between the columns. The default is None.

  • hspace (float, optional) – Space between the rows. The default is None.

  • w_pad (float or None, optional) – Padding around the axes elements in inches. The default is None.

  • h_pad (float or None, optional) – Padding around the axes elements in inches. The default is None.

  • kwargs (**) – for dpi and similar. Parsed to matplotlib plt.subplots.

Returns:

  • fig (Figure) – matplotlib.pyplot figure object.

  • axes (AxesSubplot) – matplotlib.pyplot axes objects..

Examples

>>> import amep
>>> import numpy as np
>>> fig, axs = amep.plot.new()
>>> x = np.linspace(0,10,1000)
>>> axs.plot(x, np.sin(x))