Skip to content

Commit fe168a1

Browse files
authored
Merge pull request #7878 from bjodah/vline-hline-demo-transform-factory
Update vlines example with axes wide lines.
2 parents 3b425d8 + dde66eb commit fe168a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/pylab_examples/vline_hline_demo.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
"""
2-
Small demonstration of the hlines and vlines plots.
2+
=================
3+
hlines and vlines
4+
=================
5+
6+
This example showcases the functions hlines and vlines.
37
"""
48

59
import matplotlib.pyplot as plt
10+
from matplotlib.transforms import blended_transform_factory as btf
611
import numpy as np
712
import numpy.random as rnd
813

@@ -22,6 +27,7 @@ def f(t):
2227

2328
vax.plot(t, s + nse, '^')
2429
vax.vlines(t, [0], s)
30+
vax.vlines([1, 2], 0, 1, transform=btf(vax.transData, vax.transAxes), colors='r')
2531
vax.set_xlabel('time (s)')
2632
vax.set_title('Vertical lines demo')
2733

0 commit comments

Comments
 (0)