plopp.slicer#
- plopp.slicer(obj, keep=None, *, aspect=None, autoscale=True, cbar=True, clabel=None, cmap='viridis', cmax=None, cmin=None, coords=None, enable_player=False, errorbars=True, figsize=None, grid=False, legend=True, logc=None, logx=None, logy=None, mask_cmap='gray', mask_color=None, nan_color=None, norm=None, scale=None, title=None, vmax=None, vmin=None, xlabel=None, xmax=None, xmin=None, ylabel=None, ymax=None, ymin=None, **kwargs)[source]#
Plot a multi-dimensional object by slicing one or more of the dimensions. This will produce one slider per sliced dimension, below the figure.
- Parameters:
obj (
Variable|DataArray|Dataset|DataGroup[Any] |ndarray|Node|dict[str,Variable|DataArray|Dataset|DataGroup[Any] |ndarray|Node]) – The object to be plotted.keep (
list[str] |None, default:None) – The single dimension to be kept, all remaining dimensions will be sliced. This should be a single string. If no dim is provided, the last/inner dim will be kept.aspect (
Literal['auto','equal',None], default:None) – Aspect ratio for the axes.autoscale (
bool, default:True) – Automatically scale the axes/colormap on updates ifTrue.cbar (
bool, default:True) – Show colorbar in 2d plots ifTrue.clabel (
str|None, default:None) – Label for colorscale (2d plots only).cmap (
str, default:'viridis') – The colormap to be used for the colorscale (2d plots only).cmax (
Variable|float|None, default:None) – Upper limit for colorscale (2d plots only).cmin (
Variable|float|None, default:None) – Lower limit for colorscale (2d plots only).coords (
list[str] |None, default:None) – If supplied, use these coords instead of the input’s dimension coordinates.enable_player (
bool, default:False) – IfTrue, add a play button to the sliders to automatically step through the slices.errorbars (
bool, default:True) – Show errorbars in 1d plots ifTrue.figsize (
tuple[float,float] |None, default:None) – The width and height of the figure, in inches.grid (
bool, default:False) – Show grid ifTrue.legend (
bool|tuple[float,float], default:True) – Show legend ifTrue. Iflegendis a tuple, it should contain the(x, y)coordinates of the legend’s anchor point in axes coordinates.logc (
bool|None, default:None) – IfTrue, use logarithmic scale for colorscale (2d plots only).logx (
bool|None, default:None) – IfTrue, use logarithmic scale for x-axis.logy (
bool|None, default:None) – IfTrue, use logarithmic scale for y-axis.mask_cmap (
str, default:'gray') – Colormap to use for masks in 2d plots.nan_color (
str|None, default:None) – Color to use for NaN values in 2d plots.norm (
Literal['linear','log',None], default:None) – Set to'log'for a logarithmic y-axis (1d plots) or logarithmic colorscale (2d plots). Legacy, preferlogyandlogcinstead.scale (
dict[str,str] |None, default:None) – Change axis scaling betweenlogandlinear. For example, specifyscale={'time': 'log'}if you want log-scale for thetimedimension. Legacy, preferlogxandlogyinstead.vmax (
Variable|float|None, default:None) – Upper limit for data to be displayed (y-axis for 1d plots, colorscale for 2d plots). Legacy, preferymaxandcmaxinstead.vmin (
Variable|float|None, default:None) – Lower limit for data to be displayed (y-axis for 1d plots, colorscale for 2d plots). Legacy, preferyminandcmininstead.xmax (
Variable|float|None, default:None) – Upper limit for x-axis.xmin (
Variable|float|None, default:None) – Lower limit for x-axis.ymax (
Variable|float|None, default:None) – Upper limit for y-axis.ymin (
Variable|float|None, default:None) – Lower limit for y-axis.**kwargs – Additional arguments forwarded to the underlying plotting library.
- Return type:
FigureLike