<jupyter_start><jupyter_text>Using accented text in matplotlibMatplotlib supports accented characters via TeX mathtext or unicode.Using mathtext, the following accents are provided: \hat, \breve, \grave, \bar,\acute, \tilde, \vec, \dot, \ddot.  All of them have the same syntax,e.g., to make an overbar you do \bar{o} or to make an o umlaut you do\ddot{o}.  The shortcuts are also provided, e.g.,: \"o \'e \`e \~n \.x\^y<jupyter_code>import matplotlib.pyplot as plt

# Mathtext demo
fig, ax = plt.subplots()
ax.plot(range(10))
ax.set_title(r'$\ddot{o}\acute{e}\grave{e}\hat{O}'
             r'\breve{i}\bar{A}\tilde{n}\vec{q}$', fontsize=20)

# Shorthand is also supported and curly braces are optional
ax.set_xlabel(r"""$\"o\ddot o \'e\`e\~n\.x\^y$""", fontsize=20)
ax.text(4, 0.5, r"$F=m\ddot{x}$")
fig.tight_layout()

# Unicode demo
fig, ax = plt.subplots()
ax.set_title("GISCARD CHAHUTÉ À L'ASSEMBLÉE")
ax.set_xlabel("LE COUP DE DÉ DE DE GAULLE")
ax.set_ylabel('André was here!')
ax.text(0.2, 0.8, 'Institut für Festkörperphysik', rotation=45)
ax.text(0.4, 0.2, 'AVA (check kerning)')

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1752212389380531, 'fraction_numerical': 0.016814159292035398, 'mean_word_length': 4.517073170731707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '144107', 'license': 'MIT', 'n_tokens_mistral': 495, 'n_tokens_neox': 465, 'n_words': 120, 'path': 'matplotlib/gallery_jupyter/text_labels_and_annotations/accented_text.ipynb', 'repo_name': 'kingreatwill/penter', 'size': '1130'}