How to use textrm with LaTeXStrings and the pyplot backend

Hi all,

I am trying to use a combination of math and text symbols with LaTeXStrings and the pyplot backend of Plots.jl. Unfortunately, textrm does not work for some reason. Is there anything special I need to do, or is this a bug?

MWE

using Plots, LaTeXStrings

pyplot()

histogram(randn(1000), xlabel = L"\textrm{x}")

Support for LaTeX in Pyplot is determined by the mathtext rendering engine used by Matplotlib, which supports only a subset of LaTeX math macros, not all of LaTeX.

In particular, it supports \mathrm, but not \textrm.

2 Likes

Thanks for your reply. \mathrm actually works just fine for my purposes.