Title: [Bug]: latex font doesn't apply to formatted ticks · Issue #26179 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: latex font doesn't apply to formatted ticks · Issue #26179 · matplotlib/matplotlib
X Title: [Bug]: latex font doesn't apply to formatted ticks · Issue #26179 · matplotlib/matplotlib
Description: Bug summary When latex is turned on and tick format uses specific formatters (i.e logformattermathtext, scalarformatter with scientific tuned on), the font doesn't apply and switches back to serif. Code for reproduction import matplotlib...
Open Graph Description: Bug summary When latex is turned on and tick format uses specific formatters (i.e logformattermathtext, scalarformatter with scientific tuned on), the font doesn't apply and switches back to serif....
X Description: Bug summary When latex is turned on and tick format uses specific formatters (i.e logformattermathtext, scalarformatter with scientific tuned on), the font doesn't apply and switches back to se...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26179
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: latex font doesn't apply to formatted ticks","articleBody":"### Bug summary\n\nWhen latex is turned on and tick format uses specific formatters (i.e logformattermathtext, scalarformatter with scientific tuned on), the font doesn't apply and switches back to serif.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nimport matplotlib.ticker as ticker\r\n\r\nplt.rcParams.update({\r\n \"text.usetex\": True,\r\n \"font.family\": \"sans-serif\"\r\n})\r\n\r\nfig, ax = plt.subplots()\r\nplt.plot(range(10))\r\n\r\nplt.title('Center Title')\r\nplt.title('Left Title', loc='left')\r\nplt.title('Right Title', loc='right')\r\n\r\nformatter=ticker.ScalarFormatter()\r\nformatter.set_scientific(False)\r\nax.yaxis.set_major_formatter(formatter)\r\n\r\nax.xaxis.set_minor_formatter(ticker.FormatStrFormatter('%s'))\r\nax.set_xticklabels(ax.get_xticks())\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\u003cimg width=\"1163\" alt=\"deletethiss\" src=\"https://github.com/matplotlib/matplotlib/assets/89176675/14b962d6-95fa-44fe-b257-67585d08d9c4\"\u003e\r\n\n\n### Expected outcome\n\nThe yticks should match the xtick/labels font (sans-serif) even though the formatting is different.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nLinux\n\n### Matplotlib Version\n\n3.5\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/hahmadi-cmu-F24","@type":"Person","name":"hahmadi-cmu-F24"},"datePublished":"2023-06-23T21:37:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/26179/matplotlib/issues/26179"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:69dbe751-98b0-f8e9-2e46-b8eae3edea69 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A134:30CB25:3E8ED2:55236B:6A551D34 |
| html-safe-nonce | cb3a46744128d5a67d1b448c4f25b82265e509c7ab5dd89e5b5aaf9a4a835e49 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTM0OjMwQ0IyNTozRThFRDI6NTUyMzZCOjZBNTUxRDM0IiwidmlzaXRvcl9pZCI6IjgxNzkxNzQ3MzIwMjcyMDY5NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 35ef45be59535fffd94f04d64ad2fd388f3699a4a9bdac918678dda5255869df |
| hovercard-subject-tag | issue:1772190492 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/26179/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31e07aab4f79d59639a7be2174088b80335672e1a9e16e950f41a27ca43f9e04/matplotlib/matplotlib/issues/26179 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31e07aab4f79d59639a7be2174088b80335672e1a9e16e950f41a27ca43f9e04/matplotlib/matplotlib/issues/26179 |
| og:image:alt | Bug summary When latex is turned on and tick format uses specific formatters (i.e logformattermathtext, scalarformatter with scientific tuned on), the font doesn't apply and switches back to serif.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hahmadi-cmu-F24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b6d37c6470adadff4194742daaab9a817cc4980 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width