8000 Merge pull request #21495 from meeseeksmachine/auto-backport-of-pr-21… · matplotlib/matplotlib@245b511 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 245b511

Browse files
authored
Merge pull request #21495 from meeseeksmachine/auto-backport-of-pr-21492-on-v3.5.x
Backport PR #21492 on branch v3.5.x (added parameter documentation for MultiCursor)
2 parents 4d99a6d + 1658f99 commit 245b511

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

lib/matplotlib/widgets.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,25 +1677,36 @@ class MultiCursor(Widget):
16771677
16781678
For the cursor to remain responsive you must keep a reference to it.
16791679
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.
16811687
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.
16851690
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.
16901693
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.
16941696
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`.
16951706
"""
1707+
16961708
def __init__(self, canvas, axes, useblit=True, horizOn=False, vertOn=True,
16971709
**lineprops):
1698-
16991710
self.canvas = canvas
17001711
self.axes = axes
17011712
self.horizOn = horizOn

0 commit comments

Comments
 (0)
0