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
[Bug]: Inconsistent pgf backend results from text.usetex flag #28131
Comments
See #20262 (comment) regarding difficulties of moving to using xe/luatex everywhere. |
Thanks for that info. It sounds like unifying everything using xe/lualatex is desired, but would be a difficult transition. |
I think I might understand what's going on now. The documentation was a bit unclear about what With the agg backend:
With the pgf backend:
In my original post, I had mistakenly assumed that (This is because References: |
Bug summary
The
text.usetex
rcParam flag can be used to enable TeX rendering on all Text elements instead of Mathtext. When using the pgf backend, I would expect this flag to have no effect and for the Text elements to be rendered identically since pgf also uses TeX to render.The problem is that the
usetex
renderer seems to have a different implementation than thepgf
renderer.Code for reproduction
Actual outcome
When
text.usetex
isTrue
, the tick labels use display math font to render in Tex.When
text.usetex
isFalse
, the tick labels use the regular text font to render in Tex.Expected outcome
When using the pgf backend, I would expect enabling/disabling
text.usetex
to have no effect on the output.Additional information
From what I understand, the
text.usetex
implementation has an unofficially supported rcParam for the preamble namedtext.latex.preamble
. On the other hand, the pgf implementation has an officially supported rcParam for the preamble namedpgf.preamble
. From the documentation it's unclear to me which renderer/preamble takes precedence when both pgf andusetex
are enabled.The
text.usetex
renderer also does not support XeLaTeX/LuaLaTeX according to the documentation.In conclusion:
Is there any reason why these two rendering engines can not (or should not) be unified? I suspect this is also the root cause of a lot of confusion and consistency errors people have.
Related:
#28084
Operating system
Ubuntu
Matplotlib Version
3.7.5
Matplotlib Backend
pgf
Python version
3.8.10
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: