Skip to content

Commit

Permalink
Merge pull request #275 from alhom/matplotlib_logging
Browse files Browse the repository at this point in the history
Swap usetex=True font.family as defaulted by matplotlib in any case -…
  • Loading branch information
alhom authored Sep 9, 2024
2 parents 7c37757 + 5630629 commit 339e89b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pytools.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@
if not os.getenv('PTNOLATEX'):
matplotlib.rc('text', usetex=True)
matplotlib.rcParams['text.latex.preamble'] = r'\boldmath'
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'
# matplotlib.rcParams['mathtext.fontset'] = 'stix'
# matplotlib.rcParams['font.family'] = 'STIXGeneral'
# Matplotlib suppressed logging messages came out after enabling logging.INFO: font.family must be one of (serif, sans-serif, cursive, monospace) when text.usetex is True. serif will be used by default.
matplotlib.rcParams['font.family'] = 'serif'
logging.info("Using LaTeX formatting")
# matplotlib.rcParams['text.dvipnghack'] = 'True' # This hack might fix it on some systems

Expand Down

0 comments on commit 339e89b

Please sign in to comment.