Skip to content

"Bad" deprecation warning: "Invalid escape sequence" warning incorrectly flags LaTeX #10945

@kmtac

Description

@kmtac

Bug report

Bug summary

"Bad" deprecation warning: LaTeX $\pm$ raises a DeprecationWarning: Invalid escape sequence \p.
Code for reproduction

import warnings
import matplotlib.pyplot as plt
warnings.simplefiler('always')
plt.text('Silly Error $\pm$ silliness')

Actual outcome

# If applicable, paste the console output here
>>> plt.title('Silly error $\pm$ silliness')
<stdin>:1: DeprecationWarning: invalid escape sequence \p
Text(0.5,1,'Silly error $\\pm$ silliness')

Expected outcome

No error -- This is LaTeX, surrounded by $ $, not an escape sequence. (Note that the plot itself looks fine, with a plus-minus sign.)

Matplotlib version

  • Operating system: MacOs X
  • Matplotlib version: 2.2.2
  • Matplotlib backend: notebook, Qt, MacOSX, Tk
  • Python version: 3.6.2
  • Jupyter version (if applicable): 4.3.0
  • Other libraries: warnings
conda default, conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions