Annotation with negative axes fraction coordinate placed incorrectly with v1.4.3 · Issue #4292 · matplotlib/matplotlib · GitHub
Skip to content

Annotation with negative axes fraction coordinate placed incorrectly with v1.4.3 #4292

Description

@breedlun

I am finding that annotations placed outside of axes get placed incorrectly in v1.4.3. Here is an example:

import matplotlib.pyplot as plt
import matplotlib as mpl

fig, ax = plt.subplots()

ax.annotate('+ pts', 
    xytext = [40, 20], textcoords = 'axes points', \
    xy = [40, 20], xycoords = 'axes points', fontsize = 32)
ax.annotate('- pts', 
    xytext = [40, -20], textcoords = 'axes points', \
    xy = [40, -20], xycoords = 'axes points', fontsize = 32)
ax.annotate('+ frac', 
    xytext = [0.5, 0.1], textcoords = 'axes fraction', \
    xy = [0.5, 0.1], xycoords = 'axes fraction', fontsize = 32)
ax.annotate('- frac', 
    xytext = [0.5, -0.1], textcoords = 'axes fraction', \
    xy = [0.5, -0.1], xycoords = 'axes fraction', fontsize = 32)
plt.savefig('test' + mpl.__version__ + '.png')

In matplotlib v1.4.2 the plot looks like this:
test1 4 2

In matplotlib v1.4.3 the plot looks like this:
test1 4 3

Apparently v1.4.3 takes a negative axes fraction (or points) and wraps it around to the top of the axes.

Activity

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

Metadata

Metadata

Assignees

Labels

API: changesChanges to the public API, typically requiring deprecation.Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions