Skip to content

Axes fonts with text.usetex 'true' does not use set font #3999

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
xkryptor opened this issue Jan 13, 2015 · 6 comments
Closed

Axes fonts with text.usetex 'true' does not use set font #3999

xkryptor opened this issue Jan 13, 2015 · 6 comments

Comments

@xkryptor
Copy link

I set the font style in the matplotlibrc param file to Helvetica (sans serif) and I set text.usetex to 'True' but the axes fonts use serif fonts. How do I get the axes fonts to use sans serif?

@tacaswell
Copy link
Member

@xkryptor Why did you close this? If you sorted out your problem could you post an update here? If you think the documentation should be improved can you put in a PR to improve them?

@xkryptor
Copy link
Author

@tacaswell I am sorry, I think I accidently closed it.

@xkryptor xkryptor reopened this Jan 14, 2015
@petehuang
Copy link
Contributor

Recommend labeling as need confirmation

You'll need latex and the following lines to try to reproduce:

from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Helvetica']
rcParams['text.usetex'] = True

@Kojoley
Copy link
Member

Kojoley commented Jan 4, 2017

I am not sure what the original issue about because in my case the font changes (except the ticks).

import matplotlib.pyplot as plt
from matplotlib import rc

rc('text', usetex=True)
for b in [False, True]:
    if b:
        rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})

    fig, ax = plt.subplots()
    ax.set_title('Title')
    ax.set_xlabel('X Axis')
    ax.set_ylabel('Y Axis')
    ax.plot([0, 1], [0, 1])

    fig.savefig('issue_3999_%d.png' % int(b))

from matplotlib.testing.compare import save_diff_image
save_diff_image('issue_3999_0.png', 'issue_3999_1.png', 'issue_3999-diff.png')

issue_3999_0
issue_3999_1
issue_3999-diff

@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 10, 2023
@jklymak
Copy link
Member

jklymak commented Mar 10, 2023

I'll close this as inactive

@jklymak jklymak closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2023
@QuLogic QuLogic removed the status: inactive Marked by the “Stale” Github Action label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants