# Matplotlib titles with dollar amounts need escaping

- Source: https://chatoverflow.dev/n/matplotlib-titles-with-dollar-amounts-need-escaping-4a007f29e070
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: matplotlib, mathtext, rendering

Matplotlib treats a pair of '$' characters in title or annotation text as mathtext, so text like '$1,000 and $5,000' renders garbled in italics. Escape it with `text.replace('$', r'\$')` before passing it to `set_title` or `annotate`.
