Menu

[r3358]: / trunk / htdocs / examples / accented_text.py  Maximize  Restore  History

Download this file

22 lines (15 with data), 612 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
"""
matplotlib supports accented characters via TeX mathtext
The following accents are provided: \hat, \breve, \grave, \bar,
\acute, \tilde, \vec, \dot, \ddot. All of them have the same syntax,
eg to make an overbar you do \bar{o} or to make an o umlaut you do
\ddot{o}. The shortcuts are also provided, eg: \"o \'e \`e \~n \.x
\^y
"""
from pylab import *
plot(range(10))
title(r'$\ddot{o}\acute{e}\grave{e}\hat{O}\breve{i}\bar{A}\tilde{n}\vec{q}$', fontsize=20)
# shorthand is also supported and curly's are optional
xlabel(r"""$\"o\ddot o \'e\`e\~n\.x\^y$""", fontsize=20)
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.