That makes sense to me. OTOH, we maybe could do a better job of documenting this. I don't think its trivial for a user to know that they need to setup TeX by hand this way.
I am trying to come up with a good documentation entry for this. Found 3 other issues that have the same root cause (i.e. not knowing that changing text font in TeX doesn't automatically change the math font) -- #8436, #6041, #3999.
I think an entry that says “font selection using tex” or some such would be helpful. Show changing the basic font and the math font.
Long term I really wonder if the Tex rendering should not consult the non-Tex font selection mechanisms at all, and users should set the preamble by hand to get what they want. That would reduce confusion in my mind.
Reacted by laurathepluralized and Harshal Prakash Patankar (pharshalp)
Will work on it in a day or two... looks like I might have to remove some
portions of the existing documentation (seems to be inconsistent with the
stackoverflow answer... will confirm soon). I looked at the “git blame” for
that and it seems to be 10 yrs old!
On Tue, Jul 10, 2018 at 12:07 PM Jody Klymak ***@***.***> wrote:
I think an entry that says “font selection using tex” or some such would
be helpful. Show changing the basic font and the math font.
Long term I really wonder if the Tex rendering should not consult the
non-Tex font selection mechanisms at all, and users should set the preamble
by hand to get what they want. That would reduce confusion in my mind.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11586 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOePxAmqIXJ8F0JommCcWef2LpTvbVjiks5uFNFPgaJpZM4VFZMT>
.
but then the tick labels won't be rendered using TeX (and other mathematical symbols, numbers will still be using TeX when text.usetex=True) which is inconsistent. When the user sets text.usetex = True the expected result is that all the fonts will be rendered using TeX. Hence, it would be better to ask the user to control the font by using text.latex.preamble.
The ticklabels do use tex, because text.usetex=True is set. But they are not rendered in math mode (i.e. the $ are removed). Hence they use the same font used by the rest of the document, but still through the tex system in use.
ahh right... that makes sense. But, this won't solve the issue if you have a mathematical formula in the title (or annotations) since it has to be rendered in math mode.
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!
Activity
pharshalp commented on Jul 8, 2018
this answer by @mdboom might help...
https://stackoverflow.com/a/16345065
Using that suggestion, here are the results...
BEFORE

AFTER

jklymak commented on Jul 8, 2018
That makes sense to me. OTOH, we maybe could do a better job of documenting this. I don't think its trivial for a user to know that they need to setup TeX by hand this way.
Possibly more info at?
https://matplotlib.org/tutorials/text/usetex.html
pharshalp commented on Jul 10, 2018
I am trying to come up with a good documentation entry for this. Found 3 other issues that have the same root cause (i.e. not knowing that changing text font in TeX doesn't automatically change the math font) -- #8436, #6041, #3999.
jklymak commented on Jul 10, 2018
I think an entry that says “font selection using tex” or some such would be helpful. Show changing the basic font and the math font.
Long term I really wonder if the Tex rendering should not consult the non-Tex font selection mechanisms at all, and users should set the preamble by hand to get what they want. That would reduce confusion in my mind.
pharshalp commented on Jul 10, 2018
ImportanceOfBeingErnest commented on Jul 21, 2018
As commented here, one can turn the use of tex off for the ScalarFormatter such that the set font is used for the labels as well.
pharshalp commented on Jul 21, 2018
but then the tick labels won't be rendered using TeX (and other mathematical symbols, numbers will still be using TeX when text.usetex=True) which is inconsistent. When the user sets text.usetex = True the expected result is that all the fonts will be rendered using TeX. Hence, it would be better to ask the user to control the font by using text.latex.preamble.
ImportanceOfBeingErnest commented on Jul 21, 2018
The ticklabels do use tex, because text.usetex=True is set. But they are not rendered in math mode (i.e. the $ are removed). Hence they use the same font used by the rest of the document, but still through the tex system in use.
pharshalp commented on Jul 21, 2018
ahh right... that makes sense. But, this won't solve the issue if you have a mathematical formula in the title (or annotations) since it has to be rendered in math mode.
usetex_maths_DejaVu-Sans.png

usetex_maths_cmbright.png

ImportanceOfBeingErnest commented on Jul 21, 2018
In this issue, there is no math mode text used. Hence this would solve this issue.
16 remaining items
github-actions commented on Sep 11, 2024
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!