Skip to content

setting font.family: serif does not change math font to serif. #8702

@maxnoe

Description

@maxnoe

Bug report

Bug summary

Setting

font.family: serif

Does not effect math text like ax.set_xlabel('$E / \mathrm{GeV}$').

Code for reproduction

import matplotlib.pyplot as plt

plt.rcParams['font.family'] = 'serif'
plt.plot([1, 2, 3])
plt.xlabel('$E / \mathrm{GeV}$')
plt.ylabel('E / GeV')

Actual outcome

sans-serif font for the axis label using math

test

Expected outcome

Both axes labels using serif font

Matplotlib version

  • Operating System: Ubuntu 16.10
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions