spectrochempy.multiplot#

multiplot(datasets=None, labels=None, nrow=1, ncol=1, method='lines', sharex=False, sharey=False, sharez=False, colorbar=False, suptitle=None, suptitle_color='k', mpl_event=True, return_dict=False, panel_kwargs=None, **kwargs)[source]#

Arrange datasets on a grid of Matplotlib axes.

Unlike plot_multiple(), which overlays several datasets on one shared axes, multiplot() creates one panel per dataset (unless the call degenerates to a single 1x1 plot).

Parameters:
  • datasets (nddataset or list of nddataset) – Dataset or datasets to plot.

  • labels (list of str) – The labels that will be used as title of each axes.

  • method (str, default to "lines") – Plot geometry to use in every panel. Common values are "pen", "scatter", "lines", "contour", "contourf", "image", and "with_transposed". Compatibility aliases such as "stack" and "map" are normalized internally.

  • nrow, ncol (int, default=1) – Number of rows and columns in the subplot grid. nrow * ncol must provide enough panels for the datasets to plot. The plural aliases nrows and ncols are accepted as additional keyword arguments.

  • sharex, sharey (bool or {‘none’, ‘all’, ‘row’, ‘col’}, default=False) – Controls sharing of properties among x (sharex ) or y (sharey ) axes:

    - True or 'all' : x- or y-axis will be shared among all subplots.
    - False or 'none' : each subplot x- or y-axis will be independent.
    - 'row' : each subplot row will share an x- or y-axis.
    - 'col' : each subplot column will share an x- or y-axis.
    

    When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are visible. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are visible.

  • sharez (bool or {‘none’, ‘all’, ‘row’, ‘col’}, default=False) – Equivalent to sharey for 1D plot. for 2D plot, z is the intensity axis (i.e., contour levels for maps or the vertical axis for stack plot), y is the third axis.

  • figsize (2-tuple of floats) – (width, height) tuple in inches.

  • dpi (float) – Dots per inch

  • facecolor (color) – The figure patch facecolor; defaults to rc figure.facecolor .

  • edgecolor (color) – The figure patch edge color; defaults to rc figure.edgecolor .

  • linewidth (float) – The figure patch edge linewidth; the default linewidth of the frame.

  • frameon (bool) – If False , suppress drawing the figure frame.

  • left (float in the [0-1] interval) – The left side of the subplots of the figure.

  • right (float in the [0-1] interval) – The right side of the subplots of the figure.

  • bottom (float in the [0-1] interval) – The bottom of the subplots of the figure.

  • top (float in the [0-1] interval) – The top of the subplots of the figure.

  • wspace (float in the [0-1] interval) – The amount of width reserved for blank space between subplots, expressed as a fraction of the average axis width.

  • hspace (float in the [0-1] interval) – The amount of height reserved for white space between subplots, expressed as a fraction of the average axis height.

  • suptitle (str) – Title of the figure to display on top.

  • suptitle_color (color) – Color of the figure title.

  • colorbar (bool, default=False) – Forward the colorbar request to each dataset plot.

  • mpl_event (bool, default=True) – Connect the interactive Matplotlib layout callbacks. Callbacks are connected only when Matplotlib is in interactive mode.

  • return_dict (bool, default=False) – Return fig, axes (main axes array), axes_dict and panel_axes instead of only the axes collection. panel_axes maps each grid name to the roles main and any top/right marginal axes.

  • show (bool, optional, default: True) – Whether SpectroChemPy should perform its explicit display step after plotting. In notebook environments, figures may still render inline without this explicit call.

  • output (str or pathlib.Path, optional) – File name where the whole grid is saved. Saving happens once every panel is drawn and the layout is finalized, so titles, shared limits, and the tight layout are part of the file.

  • panel_kwargs (list of dict, optional) – Per-panel plot options, merged over common kwargs. Supply one dictionary per dataset. Use this for different reference spectra, projection styles, contour levels or colorbar choices. Lifecycle and method options remain owned by the grid and cannot be overridden here.

  • height_ratios, width_ratios (sequence of float, optional) – Relative row heights and column widths.

  • **kwargs – Additional figure-layout, style, and dataset-plot options. Marginal projection panels are supported by contour/contourf maps, including their projection_data and projection_kwargs options. Mixed 1D and 2D datasets may use a method list; sharing axes across incompatible physical quantities is the caller’s responsibility.

Returns:

matplotlib.axes.Axes or numpy.ndarray or dict – A single axes for the 1x1 case, otherwise the subplot collection. Use return_dict=True to keep the internal axes naming.

Examples using spectrochempy.multiplot#

Explore an IR activation series with Noda’s 2D-COS

Explore an IR activation series with Noda's 2D-COS