{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#### **Title**: HLine Element\n", "\n", "**Dependencies**: Matplotlib\n", "\n", "**Backends**: [Matplotlib](../matplotlib/VSpans.ipynb), [Bokeh](../bokeh/VSpans.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import holoviews as hv\n", "\n", "hv.extension('matplotlib')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ``VSpans`` element is a type of annotation that can mark multiple spans along the x-axis. It accepts a list of start and end x-coordinates and will draw vertical spans at each location. This has the advantage over [``VSpan``](./VSpan.ipynb) of being able to draw multiple spans at once." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x_start = np.arange(10)\n", "x_end = x_start + np.random.random(size=10) / 2\n", "hv.VSpans((x_start, x_end)).opts(color='red')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For full documentation and the available style and plot options, use ``hv.help(hv.VSpans).``" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 }