File: C:/Users/fred/anaconda3/Lib/site-packages/holoviews/examples/reference/elements/bokeh/HSpans.ipynb
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### **Title**: HLine Element\n",
"\n",
"**Dependencies**: Bokeh 3.2\n",
"\n",
"**Backends**: [Matplotlib](../matplotlib/HSpans.ipynb), [Bokeh](../bokeh/HSpans.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import holoviews as hv\n",
"\n",
"hv.extension('bokeh')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The ``HSpans`` element is a type of annotation that can mark multiple spans along the y-axis. It accepts a list of start and end y-coordinates and will draw horizontal spans. This has the advantage over [``HSpan``](./HSpan.ipynb) of being able to draw multiple spans at once and also being able to get hover information for each of the span."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"y_start = np.arange(10)\n",
"y_end = y_start + np.random.random(size=10) / 2\n",
"hv.HSpans((y_start, y_end)).opts(tools=['hover'], color='red')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For full documentation and the available style and plot options, use ``hv.help(hv.HSpans).``"
]
}
],
"metadata": {
"language_info": {
"name": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}