forked from rougier/matplotlib-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarkers.py
More file actions
47 lines (44 loc) · 1.24 KB
/
markers.py
File metadata and controls
47 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from pylab import *
def marker(m,name):
size = 256,16
dpi = 72.0
figsize= size[0]/float(dpi),size[1]/float(dpi)
fig = figure(figsize=figsize, dpi=dpi)
fig.patch.set_alpha(0)
axes([0,0,1,1],frameon=False)
X = np.arange(11)
Y = np.ones(11)
plot(X,Y,color='w', lw=1, marker=m, ms=10, mfc=(.75,.75,1,1), mec=(0,0,1,1))
xlim(0,10)
xticks([]), yticks([])
print '../figures/marker-%s.png' % name
savefig('../figures/marker-%s.png' % name, dpi=dpi)
#print"""
#.. list-table::
# :widths: 15 30 50
# :header-rows: 1
#
# * - Symbol
# - Description
# - Appearance
#"""
for m in [0,1,2,3,4,5,6,7,'o','h','_','1','2','3','4','8','p',
'^','v','<','>','|','d',',','+','s','*','|','x']:
if type(m) is int:
marker(m, 'i%d' % m)
#print " * - %d" % m
#print " - "
#print " - .. image:: figures/marker-i%d.png" % m
else:
marker(m,m)
#print " * - ``%s``" % m
#print " - "
#print " - .. image:: figures/marker-%s.png" % m
marker('D', 'dd')
marker('H', 'hh')
marker('.', 'dot')
marker(r"$\sqrt{2}$", "latex")
#print " * - ``r'$\sqrt{2}$'``"
#print " - "
#print " - .. image:: figures/marker-latex.png"
#print