joferkington / mpldatacursor

Interactive "data cursors" (a.k.a. annotation pop-ups) for matplotlib
MIT License
194 stars 47 forks source link

clicks from one figure "leak" into other figures #56

Closed anntzer closed 8 years ago

anntzer commented 8 years ago
from matplotlib import pyplot as plt
from mpldatacursor import datacursor

plt.plot([1, 2])
plt.figure()
plt.plot([1, 2])
datacursor()
plt.show()

Clicking on the line in one figure also creates/updates the cursor on the other figure.

Python 3.5.1, matplotlib 1.5.1, tested Qt4, Qt5 and Tk backends.

tacaswell commented 8 years ago

Does datacursor attach it self to all active canvases?

anntzer commented 8 years ago

If no artists are specified, then I think the answer is yes: https://github.com/joferkington/mpldatacursor/blob/master/mpldatacursor/convenience.py#L154