| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/../../gallery/scales/../misc/../widgets/mouse_cursor.html | [Back] [Original] |
Section Navigation
fill_between with transparencyhisttype settingsplt.subplotsfloating_axes featuresNote
Go to the end to download the full example code.
This example sets an alternative cursor on a figure canvas.
Note, this is an interactive example, and must be run to see the effect.
import matplotlib.pyplot as plt
from matplotlib.backend_tools import Cursors
fig, axs = plt.subplots(len(Cursors), figsize=(6, len(Cursors) + 0.5),
gridspec_kw={'hspace': 0})
fig.suptitle('Hover over an Axes to see alternate Cursors')
for cursor, ax in zip(Cursors, axs):
ax.cursor_to_use = cursor
ax.text(0.5, 0.5, cursor.name,
horizontalalignment='center', verticalalignment='center')
ax.set(xticks=[], yticks=[])
def hover(event):
if fig.canvas.widgetlock.locked():
# Don't do anything if the zoom/pan tools have been enabled.
return
fig.canvas.set_cursor(
event.inaxes.cursor_to_use if event.inaxes else Cursors.POINTER)
fig.canvas.mpl_connect('motion_notify_event', hover)
plt.show()
[Hover over an Axes to see alternate Cursors]References
The use of the following functions, methods, classes and modules is shown in this example:
Copyright 20022012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 20122026 The Matplotlib development team.
Created using Sphinx 9.1.0.
Built from v3.11.2-1-g879ad8ebba.
Built with the PyData Sphinx Theme 0.16.1.
| Web Proxy Viewer | New URL | Original Page |