shnitsel.vis.plot.time#
General timeplots – use on anything with a time coordinate
Functions#
|
|
|
Plot some property of a single trajectory over time |
|
Plot some property of trajectories over time, aggregated as means and confidence intervals |
|
Plot some property of trajectories over time as thin lines; |
|
Plot some property of trajectories over time, aggregated by using colour |
|
Plot some property of one or many trajectories over time, |
Module Contents#
- _set_axes(data, ax=None)#
- plot_single(data, ax=None, time_coord='time')#
Plot some property of a single trajectory over time
- Parameters:
data – Data to plot
ax – A matplotlib
Axesonto which to plot; if not provided, one will be created.
- Return type:
The
Axesobject used- Raises:
ValueError – If
datahas both ‘state’ and ‘statecomb’ dimensions.
- plot_ci(data, ax=None, time_coord='time')#
Plot some property of trajectories over time, aggregated as means and confidence intervals
- Parameters:
data – Data to plot
ax – A matplotlib
Axesonto which to plot; if not provided, one will be created.
- Return type:
The
Axesobject used- Raises:
ValueError – If
datahas both ‘state’ and ‘statecomb’ dimensions.
- plot_many(data, ax=None, time_coord='time')#
Plot some property of trajectories over time as thin lines; state or statecomb is indicated by colour
- Parameters:
data – Data to plot
ax – A matplotlib
Axesonto which to plot; if not provided, one will be created.
- Return type:
The
Axesobject used- Raises:
ValueError – If
datahas both ‘state’ and ‘statecomb’ dimensions.
- plot_shaded(data, ax, time_coord='time')#
Plot some property of trajectories over time, aggregated by using colour to show how many overlap at a given point
- Parameters:
data – Data to plot
ax – A matplotlib
Axesonto which to plot; if not provided, one will be created.
- Return type:
The
Axesobject used.- Raises:
ImportError – If the
datashaderlibrary is not installed.
- timeplot(data, ax=None, trajs=None, sep=False, time_coord='time')#
Plot some property of one or many trajectories over time, possibly aggregating over trajectories, and distinguishing different states/statecombs if applicable.
- Parameters:
data (xarray.DataArray) – Data to plot
ax (matplotlib.pyplot.Axes | None) – A matplotlib
Axesonto which to plot; if not provided, one will be created.trajs (Literal['ci', 'shade', 'conv', None]) –
- How to aggregate trajectories, if at all:
None(default): do not aggregate’ci’: aggregate by confidence interval
- ’shade’: use colour to represent overlap
density using the datashader library (to produce what is sometimes called a hairplot)
sep (bool) – Whether to plot different states/statecombs separately; this will be done regardless when using
trajs='shade'.
- Return type:
The
Axesobject used- Raises:
If
datahas both ‘state’ and ‘statecomb’ dimensions.- If
axis passed when multipleAxeswill be required as states/statecombs are to be plotted separately.
- If
If
trajsis set to a value other thanNone, ‘ci’ or ‘shade’
NotImplementedError – If
trajs='conv'is used