Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
The following code fails atset_ylabel
:
importmatplotlib.pyplotaspltwithplt.style.context({'text.usetex':True}): (fig,ax)=plt.subplots()ax.set_xlabel("€")ax.set_ylabel("Δ")plt.show()
It works with$\Delta$
instead of Δ and it works if I unsettext.usetex
.
The generated tex is this:
\documentclass{article}\newcommand{\mathdefault}[1]{#1}\usepackage{type1cm}\usepackage{type1ec}\usepackage{type1ec}\usepackage{type1ec}\usepackage[utf8]{inputenc}\DeclareUnicodeCharacter{2212}{\ensuremath{-}}\usepackage[papersize=72in, margin=1in]{geometry}\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{10.000000}{12.500000}%\ifdefined\psfrag\else\hbox{}\fi%{\sffamily Δ}\end{document}
and it compiles fine with pdflatex if I replace\usepackage[utf8]{inputenc}
by\usepackage[utf8x]{inputenc}
. Otherwise the error is the same:
! Package inputenc Error: Unicode character Δ (U+0394)(inputenc) not set up for use with LaTeX.
I think this is on the side of unexpected behavior.
Versions:Python 3.8.5
andmatplotlib==3.4.1
.