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
Angled text not placed correctly with usetex in EPS #9158
Comments
Hi DTHaydon, I'm not a developer but a user (without much knowledge of the underlying programming). Perhaps I had a similar problem recently: Regards |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This is still a problem. But I think the problem has nothing to do with alignment directly, but with the angle: import matplotlib.pyplot as plt
plt.rc("text", usetex=True)
fig = plt.figure()
for i, angle in enumerate([0, 90, 180, 270]):
fig.text(0.1 + i / 5, 0.1 + i / 5, f"$\\mathrm{{Response {angle} }}$",
rotation=angle, fontsize=24)
for fmt in ['eps', 'pdf', 'png']:
fig.savefig(f"test_{fmt}.{fmt}") produces inconsistent results for everything but 0 angle. We currently place usetex using the bottom-left corner, but perhaps a different anchor should be used: matplotlib/lib/matplotlib/backends/backend_ps.py Lines 591 to 595 in 2e2d2d5
At least, always subtracting text depth from the y position seems wrong, if the text is vertical. |
Bug report
Bug summary
The text alignment of
.text(..., ha="center", va="center", ...)
whilst usingmatplotlib.rc("text", usetex=True)
and saving as.eps
is not centred.However the output is centred for
.pdf
and.png
Code for reproduction
Actual outcome
./test_eps.eps
./test_pdf.pdf
./test_png.png
Expected outcome
Ideally the output of
./test_eps.eps
should match the other two figures.System
The text was updated successfully, but these errors were encountered: