| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This solves #13028.
|
This should get a test I think. Was center_baseline working at all with rotation_mode='anchor'? |
Sorry, something went wrong.
... when rotation=0
|
@jklymak You are right. I added a test that makes sure settting rotation_mode doesn't change anything if rotation=0. |
Sorry, something went wrong.
|
Do you know if rotation != 0 appears reasonable? |
Sorry, something went wrong.
|
rotation != 0 seems to be reasonable: plt.plot([0, 1], lw=0)
plt.axvline(.5, linewidth=.5, color='.5')
plt.axhline(.5, linewidth=.5, color='.5')
N = 4
for r in range(N):
plt.text(.5, .5, 'pP', color=plt.get_cmap('jet')(r/N), size=100, rotation=r/N*360, va='center_baseline', rotation_mode='anchor')
The rotation center is not at (0.5, 0.5) but at the edge of the "p". However, I'm unsure if that's supposed to happen, also it's the same before and after this PR. So if that's an issue it's a separate one. |
Sorry, something went wrong.
|
Thanks, and congratulations on your first contribution to Matplotlib! Hoping to see you back some time. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This solves #13028: when rotation_mode='anchor' and "verticalaligment="center_baseline", the vertical alignment is wrong even if rotation=0. The vertical position of text was badly computed in this configuration, and the PR solves the problem.
PR Checklist