Step chart

URL: http://bokeh.pydata.org/en/latest/docs/gallery/step_chart.html

Most examples work across multiple plotting backends, this example is also available for:

In [1]:
import numpy as np
import holoviews as hv
hv.extension('matplotlib')

Declare data

In [2]:
# build a dataset where multiple columns measure the same thing
stamp    = [.33, .33, .34, .37, .37, .37, .37, .39, .41, .42,
            .44, .44, .44, .45, .46, .49, .49]
postcard = [.20, .20, .21, .23, .23, .23, .23, .24, .26, .27,
            .28, .28, .29, .32, .33, .34, .35]

group = "U.S. Postage Rates (1999-2015)"
stamp    = hv.Curve(stamp, vdims=['Rate per ounce'], label='stamp', group=group)
postcard = hv.Curve(postcard, vdims=['Rate per ounce'], label='postcard', group=group)
postage = (stamp * postcard)

Plot

In [3]:
plot  = dict(interpolation='steps-mid')
style = dict(linestyle=hv.Cycle(values=['--', '-']))
legend = dict(legend_position='top_left')
opts = {'Curve': {'style': style, 'plot': plot},
        'Overlay': {'plot': legend}}

postage(opts)
Out[3]:

Download this notebook from GitHub (right-click to download).