diff --git a/examples/pylab_examples/vline_hline_demo.py b/examples/pylab_examples/vline_hline_demo.py index 63f71dff4173..1959b4af8e5e 100644 --- a/examples/pylab_examples/vline_hline_demo.py +++ b/examples/pylab_examples/vline_hline_demo.py @@ -1,8 +1,13 @@ """ -Small demonstration of the hlines and vlines plots. +================= +hlines and vlines +================= + +This example showcases the functions hlines and vlines. """ import matplotlib.pyplot as plt +from matplotlib.transforms import blended_transform_factory as btf import numpy as np import numpy.random as rnd @@ -22,6 +27,7 @@ def f(t): vax.plot(t, s + nse, '^') vax.vlines(t, [0], s) +vax.vlines([1, 2], 0, 1, transform=btf(vax.transData, vax.transAxes), colors='r') vax.set_xlabel('time (s)') vax.set_title('Vertical lines demo')