joferkington / mpldatacursor

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

Does not work reliable in step diagram #36

Closed schlamar closed 7 years ago

schlamar commented 9 years ago

If I create a step diagram (randomly?) some areas do not work. Sometimes I click on the plot and nothing happens. Sometimes I select a point of from the plot and it gets selected.

joferkington commented 9 years ago

Thanks for reporting this and sorry I didn't reply earlier!

There's a partial fix in 0ef492ac496cabc9eb7ea823d390eb89032fb950. However, there's an underlying bug in the way matplotlib detects whether a point is on a line in Line2D.contains. Basically, it doesn't take into account a line's drawstyle. (plt.step is actually plt.plot(..., drawstyle='steps-pre').)

Note to self: Leaving this open as a reminder to file an MPL issue and a PR for a fix.

tacaswell commented 9 years ago

Yikes, that is a fun bug!

anntzer commented 8 years ago

Fixed upstream (matplotlib/matplotlib#6497).

schlamar commented 7 years ago

I assume this is fixed, but haven't confirmed it yet :)