spacepy.plot.levelPlot

spacepy.plot.levelPlot(data, var=None, time=None, levels=(3, 5), target=None, colors=None, **kwargs)[source]

Draw a step-plot with up to 5 levels following a color cycle (e.g. Kp index “stoplight”)

Parameters
dataarray-like, or dict-like

Data for plotting. If dict-like, the key providing an array-like to plot must be given to var keyword argument.

Returns
binnedtuple

Tuple of the binned data and bins

Other Parameters
varstring

Name of key in dict-like input that contains data

timearray-like or string

Name of key in dict-like that contains time, or arraylike of datetimes

levelsarray-like, up to 5 levels

Breaks between levels in data that should be shown as distinct colors

targetfigure or axes

Target axes or figure window

colorsarray-like

Colors to use for the color sequence (if insufficient colors, will use as a cycle)

**kwargsother keywords

Other keywords to pass to spacepy.toolbox.binHisto

Examples

>>> import spacepy.plot as splot
>>> import spacepy.time as spt
>>> import spacepy.omni as om
>>> tt = spt.tickrange('2012/09/28','2012/10/2', 3/24.)
>>> omni = om.get_omni(tt)
>>> splot.levelPlot(omni, var='Kp', time='UTC', colors=['seagreen', 'orange', 'crimson'])