Skip to content

Broken "Text Rotation Relative To Line" example #17005

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
asongtoruin opened this issue Apr 2, 2020 · 2 comments
Closed

Broken "Text Rotation Relative To Line" example #17005

asongtoruin opened this issue Apr 2, 2020 · 2 comments

Comments

@asongtoruin
Copy link
Contributor

The "Text Rotation Relative To Line" example appears to be broken in the current docs:

Misaligned rotated text

Compared to older versions of the module:

Correctly rotated text

Checking back through older versions of the documentation, it looks as though this broke in v3.2.0 as it looks to have still been fine in v3.1.3

@anntzer
Copy link
Contributor

anntzer commented Apr 2, 2020

This can be fixed e.g. by adding a call to fig.canvas.draw() before computing trans_angle, but even the "old" behavior was pretty brittle -- for example, if you interactively change the figure size, the text goes out of alignment, so I'm not too worried about losing it here. The correct solution (which is robust against figure resizes) is the one implemented in matplotlib.contour.ClabelText; right now a quick and dirty solution is to just write th1.__class__ = mpl.contour.ClabelText (ugh!) but I think it would be reasonable to move that feature (e.g. as a rotation_transform=ax.transData property) to the main Text class.

@jklymak jklymak added this to the v3.3.0 milestone Apr 2, 2020
@QuLogic QuLogic modified the milestones: v3.3.0, v3.4.0 May 27, 2020
immaxchen added a commit to immaxchen/matplotlib that referenced this issue Jun 6, 2020
immaxchen added a commit to immaxchen/matplotlib that referenced this issue Jun 19, 2020
@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic
Copy link
Member

QuLogic commented May 18, 2021

Fixed by #15532.

@QuLogic QuLogic closed this as completed May 18, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.4.0 May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants