"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import holoviews as hv\n",
"from holoviews import opts\n",
"hv.extension('bokeh')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"points = [(-0.3, -0.3), (0,0), (0.25, -0.25), (0.3, 0.3)]\n",
"overlay = hv.Spline((points,[])) * hv.Curve(points)\n",
"overlay.opts(\n",
" opts.Curve(color='#D3D3D3'), \n",
" opts.Spline(color='green', line_width=6))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the Bokeh ``Spline`` does not support the same control codes as the [matplotlib version](../matplotlib/Spline.ipynb) which is why the codes are supplied above as an empty list.\n",
"\n",
"For full documentation and the available style and plot options, use ``hv.help(hv.Spline).``"
]
}
],
"metadata": {
"language_info": {
"name": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}