joferkington / mpldatacursor

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

Cosmetic FancyArrow changes in matplotlib 1.4.x don't mix well with mpldatacursor's defaults #30

Closed joferkington closed 9 years ago

joferkington commented 9 years ago

With matplotlib <1.4, FancyArrow's are clipped to the text's bbox:

figure_1

With matplotlib 1.4.0 and greater, the arrow extends to the center of the box:

figure_1

This may or may not be considered a bug, but I need a workaround before the next release of mpldatacursor.

wilywampa commented 9 years ago

If you create the datacursor with draggable=True then click and drag the box, the line is clipped as in your first image. Maybe that hints at a workaround?

wilywampa commented 9 years ago

Good news! This commit fixes the problem: https://github.com/efiring/matplotlib/commit/896880c0ae170a7ff6fab3243995d12c69bee70c found in this issue https://github.com/matplotlib/matplotlib/issues/4140. The bad news is it's not something you can fix in mpldatacursor until the next matplotlib release.

joferkington commented 9 years ago

@wilywampa - Yes, thanks for noticing the fix in matplotlib! In the meantime, I'll probably just add a version conditional to default to a square annotation box on 1.4.x.

joferkington commented 9 years ago

Workaround added in a574ea580e076d50e243764a6d969e891a120057

tacaswell commented 9 years ago

This is also now fixed on master.