# spacepy.plot.levelPlot

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

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

  Parameters
    data array-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
    binned tuple

      Tuple of the binned data and bins

  Other Parameters
    var string

      Name of key in dict-like input that contains data

    time array-like or string

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

    levels array-like, up to 5 levels

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

    target figure or axes

      Target axes or figure window

    colors array-like

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

    **kwargs other 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'])