Skip to content

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

@breedlun

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.

Metadata

Metadata

Assignees

Labels

API: changesRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions