8000 latex textrm does not work in Cairo backend · Issue #17932 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
latex textrm does not work in Cairo backend #17932
Closed
@esheldon

Description

@esheldon

Bug report

Bug summary

Use of \textrm latex in Cairo backend raises an exception

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt

mpl.use('Cairo')
mpl.rc('text', usetex=True)

fig, ax = plt.subplots()

ax.set_xlabel(r'$x [\textrm{cm}]$')
ax.scatter([1, 2], [1, 2], marker='o')
fig.savefig('test-cairo.png')

Raises an exception

ValueError:
x [\textrm{cm}]
^ 
Unknown symbol: \textrm, found '\'  (at char 3), (line:1, col:4) 

Expected outcome

The textrm should work to produce rm text. For reference, this works fine in the Agg backend.

Matplotlib version

  • Operating system: linux ubuntu
  • Matplotlib version: 3.2.2
  • Matplotlib backend: Cairo
  • Python version: 3.7.6

Installed with conda

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0