Vline

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


Title: VLine Element

Dependencies: Matplotlib

Backends: Matplotlib, Bokeh, Plotly

In [1]:
import numpy as np
import holoviews as hv
from holoviews import opts

hv.extension('matplotlib')

The VLine element is a type of annotation that marks a position along the x-axis. Here is a VLine marking the maximum of a quadratic curve:

In [2]:
xs = np.linspace(-5,5,100)
ys = -(xs-2)**2
vline = hv.VLine(xs[ys.argmax()])

(hv.Curve((xs,ys)) * vline).opts(
    opts.Curve(color='#D3D3D3'),
    opts.VLine(color='red', linewidth=6))
Out[2]:

For full documentation and the available style and plot options, use hv.help(hv.VLine).


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