-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: text.usetex Vs. DateFormatter #22350
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
Comments
I can reproduce the problem. For reminder, the original "usetex support for dates" was requested in #2294; usetex was in fact already supported for date ticklabels but the specific problem was that date ticklabels were wrapped in The solution implemented in #18558 was to also wrap the date ticklabels in Another solution (perhaps better?) would be instead to revert all of #18558 and to just not wrap the tex string with Right now removing the |
I find text/usetext handling almost completely arbitrary in Matplotlib. I don't understand why non-math would be sans-serif, but math would have serifs - most latex documents are not setup this way, and I'd think folks who want latex fonts would want them to be consistent. Thats a slightly bigger comment than this case, but I'd argue wen we can be consistent, we should... |
My guess is that this is "historical", but I agree the whole thing is a bit of a mess :/ |
Uh oh!
There was an error while loading. Please reload this page.
Bug summary
When I set
rcParams['text.usetex'] = True
, I can't skip line in date format.For example, I can't use
DateFormatter('%d/%m\n%Y')
.Removing the skip line
\n
it works:'%d/%m\n%Y' --> '%d/%m/%Y'
.It was working before. It's stopped working since my last update/upgrade of Anaconda.
Code for reproduction
Actual outcome
Expected outcome
If I set
rcParams['text.usetex'] = True
, I have to change the data format:Additional information
Has this worked in earlier versions?
Yes.
Do you know why this bug is happening?
I couldn't find the LOG file cited in the Actual outcome (pasted above, the last line).
I mean, I couldn't find this file:
Transcript written on 09efec18b9a3c1b4d23927d49f15f25f.log
.However I managed to find a TEX file with the same name into
'/home/.cache/matplotlib/tex.cache/'
The contents of this TEX file are (I think it may help):
\documentclass{article}
\newcommand{\mathdefault}[1]{#1}
\usepackage{type1cm}
\usepackage{type1ec}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{2212}{\ensuremath{-}}
\usepackage[papersize=72in, margin=1in]{geometry}
\makeatletter\@ifpackageloaded{underscore}{}{\usepackage[strings]{underscore}}\makeatother
\makeatletter\@ifpackageloaded{textcomp}{}{\usepackage{textcomp}}\makeatother
\pagestyle{empty}
\begin{document}
% The empty hbox ensures that a page is printed even for empty inputs, except
% when using psfrag which gets confused by it.
\fontsize{20.000000}{25.000000}%
\ifdefined\psfrag\else\hbox{}\fi%
{\sffamily $\mathdefault{01/01}
\end{document}
Operating system
Opensuse Tumbleweed
Matplotlib Version
3.5.0
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.9.7
Jupyter version
jupyter lab --version: 3.2.1
Installation
conda
The text was updated successfully, but these errors were encountered: