-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Computer Modern Roman should be the default serif when using TeX backend #5860
Comments
Perhaps the ones should be changed to zeros is in this line https://github.com/matplotlib/matplotlib/blob/v2.x/lib/matplotlib/texmanager.py#L215. I would gladly contribute to it but I don't know how to test matplotlib source (I cloned the repository, and tried to follow http://matplotlib.org/devel/testing.html but nose is not properly working) |
My previous comment is wrong. The problem is in the default values of font.serif, font.sans-serif, font.monospace (I don't know if font.cursive and font.fantasy need to be changed too). Computer Modern families are not in the lists, so the first known family is loaded instead. The following may be the solution, adding Starting at line 908 in rcsteup.py:
The other thing that I don't know how to handle but it still needed is that when |
@srvanrell Can you put in a PR with that change? |
Do you mean the changes in the rcsetup.py? I can do that. Should the added |
I think third position is fine; Bitstream and DejaVu are basically equivalent. |
Yes, it should be in third position to retain the DejaVu/Bitstream as default if one of these is not installed. |
I've just put that changes in the PR #6512. However, there is one thing missing that I don't know where it should be fixed. When |
I don't think we want to try to have font.family change automatically based on text.usetex. They are independent parameters. It is up to the user to set each one as desired. |
I'm a TeX user and that surely changes my point of view. Do what you consider is the proper behavior for matplotlib |
AFAICT, The TeX backend main goal is not to have consistency with the rest of TeX, but to use TeX typesetting in plots that are consistent with the matplotlib defaults. For strict TeX consistency you can use the pgf backend, so that the text will be typeset to be consistent with the TeX document in which you are including the plot. |
I leave a working example below, just in case it is useful:
|
Closed via #6512 |
I come from this question http://stackoverflow.com/questions/16287921/python-matplotlib-change-axis-labels-legend-from-bold-to-regular-weight
There, Alexander Vogt explains that the default serif font is not Computer Modern Roman (as it is in any LaTeX document). Instead, the default is New Century School Book, and Alexander claims that it is set by texmanager.py (https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/texmanager.py). I think that maybe it wasn't the original intention when texmanager.py was written, because of the line:
and what is said in the old issue: #882
Don't you agree with Computer Modern Roman as the default serif font?.
Meanwhile, the following trick is a workaround:
The text was updated successfully, but these errors were encountered: