Curve

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


Title
Curve Element
Dependencies
Bokeh
Backends
Bokeh
Matplotlib
Plotly
In [1]:
import numpy as np
import holoviews as hv
hv.extension('bokeh')

Curve Elements are used to display quantitative values over a continuous interval or time span. They accept tabular data with one key dimension representing the samples along the x-axis and one value dimension of the height of the curve at for each sample. See the Tabular Datasets user guide for supported data formats, which include arrays, pandas dataframes and dictionaries of arrays.

Simple Curve

A Curve is a set of values provided for some set of keys from a continuously indexable 1D coordinate system, where the plotted values will be connected up because they are assumed to be samples from a continuous relation.

In [2]:
points = [(0.1*i, np.sin(0.1*i)) for i in range(100)]
hv.Curve(points)
Out[2]:

Interpolation

The Curve also supports the interpolation plot option to determine whether to linearly interpolate the curve values or to draw discrete steps:

In [3]:
overlay =hv.NdOverlay({interp: hv.Curve(points[::8]).opts(interpolation=interp, width=600)
                       for interp in ['linear', 'steps-mid', 'steps-pre', 'steps-post']})
overlay.opts(legend_position='right')
Out[3]:

For full documentation and the available style and plot options, use hv.help(hv.Curve).


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