Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix vertical alignment of text#13029

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 2 commits intomatplotlib:masterfromstefraynaud:bug_rotation_mode_center_baseline
Dec 23, 2018
Merged

Fix vertical alignment of text#13029

timhoffm merged 2 commits intomatplotlib:masterfromstefraynaud:bug_rotation_mode_center_baseline
Dec 23, 2018

Conversation

stefraynaud
Copy link
Contributor

PR Summary

This solves#13028: whenrotation_mode='anchor' and"verticalaligment="center_baseline", the vertical alignment is wrong even ifrotation=0. The vertical position of text was badly computed in this configuration, and the PR solves the problem.

PR Checklist

@jklymak
Copy link
Member

This should get a test I think. Wascenter_baseline working at all withrotation_mode='anchor'?

@stefraynaud
Copy link
ContributorAuthor

stefraynaud commentedDec 21, 2018
edited
Loading

@jklymak You are right. I added a test that makes sure settting rotation_mode doesn't change anything if rotation=0.

@QuLogic
Copy link
Member

Do you know ifrotation != 0 appears reasonable?

@timhoffm
Copy link
Member

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 = 4for 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')

before:
image

after:
image

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.

@timhoffmtimhoffm merged commitedeccc6 intomatplotlib:masterDec 23, 2018
@timhoffm
Copy link
Member

Thanks, and congratulations on your first contribution to Matplotlib! Hoping to see you back some time.

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

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

5 participants
@stefraynaud@jklymak@QuLogic@timhoffm@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp