10000 Bad rotation_mode/center_baseline combination even if rotation=0 · Issue #13028 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Bad rotation_mode/center_baseline combination even if rotation=0 #13028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stefraynaud opened this issue Dec 20, 2018 · 1 comment
Closed

Bad rotation_mode/center_baseline combination even if rotation=0 #13028

stefraynaud opened this issue Dec 20, 2018 · 1 comment
Milestone

Comments

@stefraynaud
Copy link
Contributor

Bug report

Bug summary

When rotation_mode='anchor' and "verticalaligment="center_baseline", the vertical alignment is wrong even if ``rotation=0```.

Code for reproduction

import matplotlib.pyplot as plt

plt.plot([0, 1], lw=0)
plt.axvline(.5, linewidth=.5, color='.5')
plt.axhline(.5, linewidth=.5, color='.5')
plt.text(.5, .5, 'pP', color='k', size=100, va='center_baseline')
plt.text(.5, .5, 'pP', color='tab:red', size=100, va='center_baseline', rotation_mode='anchor')

Actual outcome

text_rotation_bug

Expected outcome

text_rotation_bug
Same alignment in this case.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: 3.0.2
  • Matplotlib backend (print(matplotlib.get_backend())): agg, tkagg
  • Python version: 3.6
  • Jupyter version (if applicable):
  • Other libraries:

Installed via conda.

timhoffm pushed a commit that referenced this issue Dec 23, 2018
* Fix vertical alignment of text

This solves #13028.

* Add test to make sure rotation_mode does break text position

... when rotation=0
@timhoffm
Copy link
Member

Fixed by #13029.

@tacaswell tacaswell added this to the v3.1 milestone Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0