-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Coordinates of text not properly set in pgf files #8067
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
Comments
attn @pwuertz |
I assume what is happening here is that matplotlib uses a fixed position for titles and legends and aligns them by their baseline. As far as I can remember the traditional matplotlib backends never took baseline offset of LaTeX elements into account. This means that text rendered via traditional LaTeX backend is simply shifted upwards so the bottom of the text box sits on the baseline, which is actually incorrect but wouldn't result in this overlap you are seeing now (hence nobody identifies this as incorrect behaviour). I'm pretty sure the font metrics returned from the PGF backend are correct, especially the alignment of the baselines. So with backend PGF matplotlib baseline-alignes the text element at the fixed title position, the large formula goes way below the baseline and overlaps with the figure. Matplotlib won't automatically adapt the figure layout for you, even if text elements are larger/overlapping. Perhaps |
Thanks for the response. Using the modification plt.title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty" helps with this issue. |
Sorry, I accidently closed the issue without your consent. If you consider it closed, close it again. Regards Jakob |
Uh oh!
There was an error while loading. Please reload this page.
Bug summary
The coordinates of text (legends, titles) are not properly set in pgf files.
Code for reproduction
Producing the pgf figure with a slightly altered pylab_examples "tex_demo.py":
Taking this pgf file ("tex_demo.pgf") in my latex file:
Actual outcome
This gives the output "Bugreport.pdf".
Bugreport.pdf
Expected outcome
The graphic should look like in the example:
http://matplotlib.org/examples/pylab_examples/tex_demo.html
Matplotlib version
The text was updated successfully, but these errors were encountered: