scipp.plot
scipp.plot#
- scipp.plot(obj, aspect='auto', cbar=True, crop=None, errorbars=True, grid=False, ignore_size=False, mask_color='black', norm='linear', scale=None, title=None, vmin=None, vmax=None, **kwargs)#
Plot a Scipp object.
- Parameters
obj (
Union
[Variable
,DataArray
,Dataset
,ndarray
,Dict
[str
,Union
[Variable
,DataArray
,Dataset
,ndarray
]]]) – The object to be plotted.aspect (
Literal
[‘auto’, ‘equal’], default:'auto'
) – Aspect ratio for the axes.cbar (
bool
, default:True
) – Show colorbar in 2d plots ifTrue
.crop (
Optional
[Dict
[str
,Dict
[str
,Variable
]]], default:None
) – Set the axis limits. Limits should be given as a dict with one entry per dimension to be cropped. Each entry should be a nested dict containing scalar values for'min'
and/or'max'
. Example:da.plot(crop={'time': {'min': 2 * sc.Unit('s'), 'max': 40 * sc.Unit('s')}})
errorbars (
bool
, default:True
) – Show errorbars in 1d plots ifTrue
.grid (
bool
, default:False
) – Show grid ifTrue
.ignore_size (
bool
, default:False
) – IfTrue
, skip the check that prevents the rendering of very large data objects.mask_color (
str
, default:'black'
) – Color of masks in 1d plots.norm (
Literal
[‘linear’, ‘log’], default:'linear'
) – Set to'log'
for a logarithmic y-axis (1d plots) or logarithmic colorscale (2d plots).scale (
Optional
[Dict
[str
,str
]], default:None
) – Change axis scaling betweenlog
andlinear
. For example, specifyscale={'tof': 'log'}
if you want log-scale for thetof
dimension.vmin (
Optional
[Variable
], default:None
) – Lower bound for data to be displayed (y-axis for 1d plots, colorscale for 2d plots).vmax (
Optional
[Variable
], default:None
) – Upper bound for data to be displayed (y-axis for 1d plots, colorscale for 2d plots).**kwargs – All other kwargs are directly forwarded to Matplotlib, the underlying plotting library. The underlying functions called are the following: - 1d data with a non bin-edge coordinate:
plot
- 1d data with a bin-edge coordinate:step
- 2d data:pcolormesh
- Returns
A figure.