@@ -1677,25 +1677,36 @@ class MultiCursor(Widget):
1677
1677
1678
1678
For the cursor to remain responsive you must keep a reference to it.
1679
1679
1680
- Example usage::
1680
+ Parameters
1681
+ ----------
1682
+ canvas : `matplotlib.backend_bases.FigureCanvasBase`
1683
+ The FigureCanvas that contains all the axes.
1684
+
1685
+ axes : list of `matplotlib.axes.Axes`
1686
+ The `~.axes.Axes` to attach the cursor to.
1681
1687
1682
- from matplotlib.widgets import MultiCursor
1683
- import matplotlib.pyplot as plt
1684
- import numpy as np
1688
+ useblit : bool, default: True
1689
+ Use blitting for faster drawing if supported by the backend.
1685
1690
1686
- fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)
1687
- t = np.arange(0.0, 2.0, 0.01)
1688
- ax1.plot(t, np.sin(2*np.pi*t))
1689
- ax2.plot(t, np.sin(4*np.pi*t))
1691
+ horizOn : bool, default: False
1692
+ Whether to draw the horizontal line.
1690
1693
1691
- multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1,
1692
- horizOn=False, vertOn=True)
1693
- plt.show()
1694
+ vertOn: bool, default: True
1695
+ Whether to draw the vertical line.
1694
1696
1697
+ Other Parameters
1698
+ ----------------
1699
+ **lineprops
1700
+ `.Line2D` properties that control the appearance of the lines.
1701
+ See also `~.Axes.axhline`.
1702
+
1703
+ Examples
1704
+ --------
1705
+ See :doc:`/gallery/widgets/multicursor`.
1695
1706
"""
1707
+
1696
1708
def __init__ (self , canvas , axes , useblit = True , horizOn = False , vertOn = True ,
1697
1709
** lineprops ):
1698
-
1699
1710
self .canvas = canvas
1700
1711
self .axes = axes
1701
1712
self .horizOn = horizOn
0 commit comments