Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Inconsistent handling of whitespace with LaTeX #4954

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
lgeiger opened this issue Aug 18, 2015 · 4 comments
Closed

Inconsistent handling of whitespace with LaTeX #4954

lgeiger opened this issue Aug 18, 2015 · 4 comments
Labels
backend: svg status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: text/usetex topic: text

Comments

@lgeiger
Copy link

lgeiger commented Aug 18, 2015

Hi matplotlib developers,

I noticed some inconstancies regarding text rendering with usetex=True.
I placed the following text with plt.text() in my plot.

begin{eqnarray*}
\phi &=& 1.00 \pm 0.10 \\
a &=& 3.00 \pm 0.30 m \\
\frac{\chi^2}{ndof} &=& 1.13
\end{eqnarray*}

If the plot is saved as .png or .pdf, the whitespace around the equal signs is to big:
bildschirmfoto 2015-08-18 um 20 34 40

If saved as .svg everything looks good:
bildschirmfoto 2015-08-18 um 20 34 27

It would be great if whitespace would be consistent in all file formats.
A possibility to align text without LaTeX would also be greatly appreciated.

Thanks

@tacaswell tacaswell added this to the proposed next point release milestone Aug 18, 2015
@tacaswell
Copy link
Member

There are two PRs open (#4873, #4872) that address this. Do either of them fix this?

I think we might be delegating the equation rendering in the svg backend to your viewer.

@lgeiger
Copy link
Author

lgeiger commented Aug 18, 2015

For some reason the current matplotlib master doesn't work on my machine. So I'm not able to test the PRs at the moment.

You are right, the error lies in the svg backend or in the viewer. The pdf and png renderings are equal to what LaTeX does outside of matplotlib.
If the align* environment is used instead of eqnarray* with \usepackage{amsmath} in the preamble, everything is consistent across all file formats.

@tacaswell
Copy link
Member

Oh, sorry I misread your post. If you are using usetex=True what you are getting as a png of the latex output embedded in your plot so it is 'correct' (in that we use latex as the reference standard for our internal mathtex layout engine which is what those PRs are working on).

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@github-actions
Copy link

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!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Mar 16, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2023
@rcomer rcomer added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: svg status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: text/usetex topic: text
Projects
None yet
Development

No branches or pull requests

4 participants