Annotation text bbox calculated incorrectly in matplotlib>=1.4.3? · Issue #4139 · matplotlib/matplotlib · GitHub
Skip to content

Annotation text bbox calculated incorrectly in matplotlib>=1.4.3? #4139

Description

@joferkington

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.

As an example:

import matplotlib.pyplot as plt
import matplotlib

fig, ax = plt.subplots()

ax.annotate('Matplotlib {}'.format(matplotlib.__version__),
            xy=(0.1, 0.1), xytext=(50, 50), size=20,
            xycoords='data', textcoords='offset points',
            bbox=dict(alpha=0.5, fc='yellow'),
            arrowprops=dict(arrowstyle='->'))

plt.show()

mpl1 4 2

mpl1 4 3

mpl_github

This may be related to #4012?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions