matplotlib.widgets.MultiCursor#

class matplotlib.widgets.MultiCursor(*args, useblit=True, horizOn=False, vertOn=True, **lineprops)[source]#

Bases: Widget

Provide a vertical (default) and/or horizontal line cursor shared between multiple Axes.

Call signatures:

MultiCursor(axes, *, ...)
MultiCursor(canvas, axes, *, ...)  # deprecated

For the cursor to remain responsive you must keep a reference to it.

Parameters:
canvasobject

This parameter is entirely unused.

Deprecated since version 3.11.

axeslist of Axes

The Axes to attach the cursor to.

useblitbool, default: True

Use blitting for faster drawing if supported by the backend. See the tutorial Faster rendering by using blitting for details.

horizOnbool, default: False

Whether to draw the horizontal line.

vertOnbool, default: True

Whether to draw the vertical line.

Other Parameters:
**lineprops

Line2D properties that control the appearance of the lines. See also axhline.

Examples

See Multicursor.

clear(event)[source]#

Clear the cursor.

connect()[source]#

Connect events.

disconnect()[source]#

Disconnect events.

onmove(event)[source]#

Examples using matplotlib.widgets.MultiCursor#

Multicursor

Multicursor