-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyplot.py
32 lines (24 loc) · 960 Bytes
/
pyplot.py
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
import numpy as np
import matplotlib.pyplot as plt
plt.plot(range(10), linestyle='--', marker='o', color='b', label='line with marker')
plt.legend()
plt.show()
markers = ['.',',','o','v','^','<','>','1','2','3','4','8','s','p','P','*','h','H','+','x','X','D','d','|','_']
descriptions = ['point', 'pixel', 'circle', 'triangle_down', 'triangle_up','triangle_left',
'triangle_right', 'tri_down', 'tri_up', 'tri_left', 'tri_right', 'octagon',
'square', 'pentagon', 'plus (filled)','star', 'hexagon1', 'hexagon2', 'plus',
'x', 'x (filled)','diamond', 'thin_diamond', 'vline', 'hline']
x=[]
y=[]
for i in range(5):
for j in range(5):
x.append(i)
y.append(j)
plt.figure(figsize=(8, 8))
for i,j,m,l in zip(x,y,markers,descriptions):
plt.scatter(i,j,marker=m)
plt.text(i-0.15,j+0.15,s=m+' : '+l)
plt.axis([-0.1,4.8,-0.1,4.5])
plt.axis('off')
plt.tight_layout()
plt.show()