-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Resolve 'text ignores rotational part of transformation' (#698) #15532
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
Resolve 'text ignores rotational part of transformation' (#698) #15532
Conversation
Do we really want to expose a control knob as to whether rotation affects text? It would seem(??) like we generally do want it to affect text. Perhaps just have that for a transition period and warn if the transform has nonzero rotation but that rotation was getting ignored and won't be ignored after the transition? |
Not sure how it works internally, but wouldn't that rotate tick labels on a polar plot? |
Ah, fair point. |
Does this need a whatsnew note? |
Sure, no problem. |
This needs a rebase to resolve conflicts. |
8e28935
to
800e810
Compare
@immaxchen I took the liberty of rebasing and force-pushing for you, I hope you do not mind. |
sure & thank you for the help. |
To what extent would it be possible to make this also improve the situation with #17005? |
lib/matplotlib/text.py
Outdated
if self.get_transform_rotates_text(): | ||
angle = get_rotation(self._rotation) | ||
x, y = self.get_unitless_position() | ||
return self.get_transform().transform_angles([angle, ], [[x, y]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it has type instability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the inconsistent type, but don't know why CI keeps failing.. i think i didn't do anything about docs in the new commit
(edit) it turns out that a rebase is needed to pass CI ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tacaswell resolved, please have a look
dac1bb2
to
230f0fb
Compare
68ed931
to
cee60e7
Compare
…lib#698) Considering the text rotation don't get transformed may by a desired behavior (such as text for annotation to some data point). Here made it as an option to control whether or not the text rotation get transformed.
44df434
to
68cfd75
Compare
examples/text_labels_and_annotations/text_rotation_relative_to_line.py
Outdated
Show resolved
Hide resolved
doc/users/next_whats_new/2019-12-22_transform-rotates-text-direction.rst
Outdated
Show resolved
Hide resolved
doc/users/next_whats_new/2019-12-22_transform-rotates-text-direction.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why Travis didn't report here, but it's green.
PR Summary
Considering the text rotation don't get transformed may be a desired behavior
(such as text for annotation to some data point). Here made it as an option to
control whether or not the text rotation get transformed.
PR Checklist