{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#### **Title**: HLine Element\n", "\n", "**Dependencies**: Bokeh 3.2\n", "\n", "**Backends**: [Matplotlib](../matplotlib/HLines.ipynb), [Bokeh](../bokeh/HLines.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 ``HLines`` element is a type of annotation that can mark multiple lines along the y-axis. It accepts a list of y-coordinates and will draw a horizontal line at each location. This has the advantage over [``HLine``](./HLine.ipynb) of being able to draw multiple lines at once and also being able to get hover information for each of the line." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ys = np.random.normal(size=10)\n", "hv.HLines(ys).opts(tools=['hover'], color='red', line_width=5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For full documentation and the available style and plot options, use ``hv.help(hv.HLines).``" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 }