Spline

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

The Spline annotation is used to draw cubic Bezier curves. In the overlay below, the spline is in green and the control points are shown by the light grey line:

In [2]:
%%opts Curve (color='#D3D3D3') Spline (linewidth=6 edgecolor='green')
points = [(-0.3, -0.3), (0,0), (0.25, -0.25), (0.3, 0.3)]
hv.Spline((points, [1,4,4,4])) * hv.Curve(points)
Out[2]:

The first argument to Splines are the control point positions and the integers in the second list are the control codes, as documented in the matplotlib splines documentation .


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