-
-
Notifications
You must be signed in to change notification settings - Fork 970
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
"text positioning with transforms" example (figure 2.4) should perhaps normalize dx, dy by 72, not by fig.dpi #79
Comments
You're right! Could you make a PR (for both book content and script)? |
Can I leave that to you? :) Especially as I think (as noted above) there are some editorial decisions as to how to handle the redundancy with figure 2.5. |
Sure. Note that it's not really redundant with figure 2.5 since in that case I use a blended transform to mix data/figue coordinate. |
Closed by 8d14fc2, afaict. Thanks :) |
@rougier I recently realized that these examples can be implemented much more simply by using annotate(), which effectively provides a specialized version of ScaledTranslation; see https://github.com/matplotlib/matplotlib/pull/25905/files. |
Oh thanks for the ref, I did not think of it and I confirm it would be worth a mention in the text. Do you want to make a PR? |
I'd rather leave the word-smithing to you :) |
The code for figure 2.4 is reproduced below for convenience:
I believe the scaling of dx, dy should be a division by 72, not by fig.dpi (more or less as you do in figure 2.5, in fact), as otherwise the appearance of the figure will depend on figure.dpi; e.g.
You can verify that here, the visual appearance of the top axis changes whereas the bottom one doesn't.
In a sense, this is redundant with figure 2.5; but perhaps division-by-72 should really be mentioned first and division-by-fig.dpi is more a side possibility?
The text was updated successfully, but these errors were encountered: