Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

visualization.plot.plot_carpet

visualization.plot.plot_carpet

Classes

NameDescription
CarpetConfigConfiguration object for controlling the aesthetics of xmris Carpet Plots.

Functions

NameDescription
plot_carpetGenerate a publication-ready 2D carpet plot of stacked 1D spectra.

plot_carpet

visualization.plot.plot_carpet.plot_carpet(
    da,
    x_dim=None,
    stack_dim=None,
    ax=None,
    config=None,
)

Generate a publication-ready 2D carpet plot of stacked 1D spectra.

This function automatically resolves missing dimensions, applies a truncated colormap to avoid print saturation, and overlays a highly readable measurement grid.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayThe N-dimensional DataArray containing the spectroscopic data.required
x_dimstrThe dimension to plot along the horizontal axis. If None, auto-resolves.None
stack_dimstrThe dimension to plot along the vertical axis. If None, auto-resolves.None
axplt.AxesA pre-existing matplotlib Axes object to plot onto.None
configCarpetConfigA configuration dataclass defining all aesthetic parameters.None

Returns

NameTypeDescription
plt.AxesThe matplotlib Axes object containing the rendered carpet plot.