nigsp.viz.plot_greyplot¶
- nigsp.viz.plot_greyplot(timeseries, filename=None, title=None, resize=None, closeplot=False)[source]¶
Create a greyplot (a.k.a. carpet plot a.k.a. timeseries plot).
If timeseries has 3 dimensions, average first along the last axis.
- Parameters:
- timeseries
numpy.ndarray
An array representing a timeseries. Time has to be encoded in the second dimension (axis=1).
- filename
None
,str
, oros.PathLike
, optional The path to save the plot on disk.
- title
None
orstr
, optional Add a title to the graph
- resize‘spc’, ‘norm’, ‘gnorm’, ‘demean’, ‘gdemean’
tuple
,list
, orNone
, optional Whether to resize the signal or not before plotting. If ‘spc’, compute signal percentage change If ‘norm’, normalise signals (z-score) If ‘gnorm’, globally normalise signals (keep relationship between timeseries) If ‘demean’, remove signal average If ‘gdemean’, remove global average If ‘gsr’, remove global signal (average across points) If tuple or list, rescale signals between those two values If None, don’t do anything (default)
- closeplot
bool
, optional Whether to close plots after saving or not. Mainly used for debug or use with live python/ipython instances.
- timeseries
- Returns:
- 0
If there are no errors.
- Raises:
ImportError
If matplotlib is not installed.
ValueError
If timeseries has more than 3 dimensions.
Notes
Requires matplotlib See timeseries.rescale_ts