Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Text rotation patch #19114

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

Conversation

Alex-Carter01
Copy link

PR Summary

Resolves issue #13044. Fixing calculation error of Y-offset for specific rotation mode of text. This pull also includes a proposed minimal test (based off the original bug report).

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [N/A] New features are documented, with examples if plot related.
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

fix to error in calculation of Y offset in text rotation.
todo: test and test baseline
see baseline_images for corresponding baseline
@jklymak
Copy link
Member

jklymak commented Dec 15, 2020

Thanks a lot for the pull request! Unfortunately this broke some existing tests in test_text.py, so this isn't compatible with the existing behaviour. So you will either have to change the old tests and argue that they were wrong, or modify this....

@story645
Copy link
Member

story645 commented Apr 6, 2021

hey @Alex-Carter01, do you have any bandwidth to finish up this PR?

@WeatherGod
Copy link
Member

Oh, and we should double-check with the Cairo renderer, although I suspect it might have the same bug if this is happening at a layer above AGG/Cairo?

@dstansby
Copy link
Member

Thanks for opening this PR. Unfortunately I don't think this is the correct fix. ymax1 - baseline / 2.0 seems to be the correct logic, putting the offset halfway between the baseline and ymax, so I think subtracting ymin1 is incorrect. As such I'm going to close this PR - if I've missed something feel free to comment and I will open it up again, and thanks again for the contribution.

@dstansby dstansby closed this Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants