-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Alignment of minus sign when using LaTeX #28766
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
Matplotlib just grabs the generated image, cropped to minimal size, and position it in the correct location. Although it may seem silly that this example doesn't work, one may also imagine much more complicated equations with multiple fractions etc, where it is clear that there is no way to really align two different equations as if they were written as one. That information is simply missing in the output Matplotlib gets. |
One could add that information by adding a constant prefix including letters with descenders and ascenders, e.g. "gH", and then strip away the prefix. |
I thought we did measure something with |
Actually the information is already available (#16476), and indeed the bug is not present in any backend except agg; the problem arises because, even though the dvi file correctly places the minus sign well above the intended baseline position, the dvi parser cannot report the raster image of the minus sign as having "negative" depth (likely ultimately because in |
Bug summary
There seems to be a different alignment for the minus sign depending on if the string contains only the minus sign or more characters when LaTeX is used.
Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
macOS Sonoma 14.6.1
Matplotlib Version
3.9.2
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.10.13
Jupyter version
6.5.4
Installation
conda
The text was updated successfully, but these errors were encountered: