You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Annotation text bbox calculated incorrectly in matplotlib>=1.4.3? #4139
Prior to matplotlib 1.4.3, text bounding boxes created with annotate did not include the connection arrow. Starting with 1.4.3 and continuing up to the current HEAD, the bbox includes the connection arrow.
It is related to #4023. The issue is that the Annotation draw method calls the Text draw method to draw the text box portion. Inside that, it calls bbox_artist from the patches modules which then calls get_window_extent of the instance.
There's even more: if boxstyle='square' is added to the bbox dictionary kwarg in the example, so that a FancyBboxPatch is drawn, then the filled region is correct, but the arrow is not clipped correctly.
Activity
jenshnielsen commentedon Feb 21, 2015
I think this is likely due to #4023 which was merged as 26c7d65
tacaswell commentedon Feb 21, 2015
I agree with @jenshnielsen's diagnosis. Someplace a call to
self.get_window_extent()needs to be changed toText.get_window_extent(self)`.cimarronm commentedon Feb 22, 2015
It is related to #4023. The issue is that the
Annotationdraw method calls theTextdraw method to draw the text box portion. Inside that, it callsbbox_artistfrom the patches modules which then callsget_window_extentof the instance.efiring commentedon Mar 1, 2015
There's even more: if
boxstyle='square'is added to thebboxdictionary kwarg in the example, so that a FancyBboxPatch is drawn, then the filled region is correct, but the arrow is not clipped correctly.tacaswell commentedon Mar 1, 2015
The clipping is related to #4012 I think.