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:
timeseriesnumpy.ndarray

An array representing a timeseries. Time has to be encoded in the second dimension (axis=1).

filenameNone, str, or os.PathLike, optional

The path to save the plot on disk.

titleNone or str, optional

Add a title to the graph

resize‘spc’, ‘norm’, ‘gnorm’, ‘demean’, ‘gdemean’ tuple, list, or None, 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)

closeplotbool, optional

Whether to close plots after saving or not. Mainly used for debug or use with live python/ipython instances.

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