Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99de373

Browse files
committed
MEP12 on stix_fonts_demo.py
1 parent ecce9a1 commit 99de373

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

examples/pylab_examples/stix_fonts_demo.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#!/usr/bin/env python
2-
3-
from __future__ import unicode_literals
4-
51
import os
62
import sys
73
import re
8-
94
import gc
5+
import matplotlib.pyplot as plt
6+
7+
from __future__ import unicode_literals
108

119
stests = [
12-
r'$\mathcircled{123} \mathrm{\mathcircled{123}} \mathbf{\mathcircled{123}}$',
13-
r'$\mathsf{Sans \Omega} \mathrm{\mathsf{Sans \Omega}} \mathbf{\mathsf{Sans \Omega}}$',
10+
r'$\mathcircled{123} \mathrm{\mathcircled{123}} \
11+
\mathbf{\mathcircled{123}}$',
12+
r'$\mathsf{Sans \Omega} \mathrm{\mathsf{Sans \Omega}} \
13+
\mathbf{\mathsf{Sans \Omega}}$',
1414
r'$\mathtt{Monospace}$',
1515
r'$\mathcal{CALLIGRAPHIC}$',
1616
r'$\mathbb{Blackboard \pi}$',
@@ -22,24 +22,19 @@
2222
if sys.maxunicode > 0xffff:
2323
s = r'Direct Unicode: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
2424

25-
from pylab import *
26-
27-
2825
def doall():
2926
tests = stests
3027

31-
figure(figsize=(8, (len(tests) * 1) + 2))
32-
plot([0, 0], 'r')
33-
grid(False)
34-
axis([0, 3, -len(tests), 0])
35-
yticks(arange(len(tests)) * -1)
28+
plt.figure(figsize=(8, (len(tests) * 1) + 2))
29+
plt.plot([0, 0], 'r')
30+
plt.grid(False)
31+
plt.axis([0, 3, -len(tests), 0])
32+
plt.yticks(arange(len(tests)) * -1)
3633
for i, s in enumerate(tests):
37-
#print(i, s.encode("ascii", "backslashreplace"))
38-
text(0.1, -i, s, fontsize=32)
34+
plt.text(0.1, -i, s, fontsize=32)
3935

40-
savefig('stix_fonts_example')
41-
#close('all')
42-
show()
36+
plt.savefig('stix_fonts_example')
37+
plt.show()
4338

4439
if '--latex' in sys.argv:
4540
fd = open("stix_fonts_examples.ltx", "w")

0 commit comments

Comments
 (0)