tex_safe#

popo.plotting.style.tex_safe(text)#

Escape a string for LaTeX, for anything interpolated from data.

A no-op when text.usetex is off: the escape sequences this produces (e.g. \_ for a literal underscore) are only meaningful to a real TeX engine, and would otherwise render as a literal backslash in mathtext.

Return type:

str