Using a simple code like below, the annotations I get for the cursors are "x:<>, y:<>" How can I change the code so I see: "xaxis:<>, yaxis:<>"
Also it would help to know how to do this if I have multiple subplots... enter image description here
import matplotlib.pyplot as plt
import numpy as np
import mplcursors
data = np.outer(range(10), range(1, 5))
fig, ax = plt.subplots()
lines = ax.plot(data)
ax.set_title("Click somewhere on a line.\nRight-click to deselect.\n"
"Annotations can be dragged.")
mplcursors.cursor(lines) # or just mplcursors.cursor()
plt.xlabel('xaxis')
plt.ylabel('ylabel')
plt.show()
You can change the annotation by adding a function to be called when the annotation is activated. Such a function can be in lambda form ("anonymous function"), or a separately written function in Python. When working with subplots, a cursor can be added to each of them.
You can take a look at the examples in the official documentation to get an overview of the possibilities.