随机颜色
def randomcolor():
colorArr = ['1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']
color = ""
for i in range(6):
color += colorArr[random.randint(0,14)]
return "#"+color
设定画布大小
plt.figure(figsize=(30,18),dpi = 300)
生成子图
plt.subplot(3,2,1) # 表示画布结构为3行2列,当前为第一幅画
for i in range(len(result_1)):
plt.scatter(np.arange(1024), result_1[i], c=randomcolor(),s=10)
plt.subplot(3,2,2) #当前为第二幅画
for i in range(len(result_2)):
plt.scatter(np.arange(1024), result_2[i], c=randomcolor(),s=10)
plt.subplot(3,2,3) # 当前为第三幅画
for i in range(len(result_3)):
plt.scatter(np.arange(1024), result_3[i], c=randomcolor(),s=10)
plt.subplot(3,2,4) #当前为第四幅画
for i in range(len(result_4)):
plt.scatter(np.arange(1024), result_4[i], c=randomcolor(),s=10)
plt.subplot(3,2,5) #当前为第五幅画
for i in range(len(result_5)):
plt.scatter(np.arange(1024), result_5[i], c=randomcolor(),s=10)
plt.subplot(3,2,6) #当前为第六幅画
for i in range(len(result_6)):
plt.scatter(np.arange(1024), result_6[i], c=randomcolor(),s=10)
plt.grid() # 生成网格
plt.xlim(110,160) #横轴的范围为110-160之间
plt.show()
标记点
| marker |
type |
含义 |
| “.” |
point |
点 |
| “,” |
pixel |
像素 |
| “o” |
circle |
圆 |
| “v” |
triangle_down |
下三角 |
| “^” |
triangle_up |
上三角 |
| “<” |
triangle_left |
左三角 |
| “>” |
triangle_right |
右三角 |
| “1” |
tri_down |
类似奔驰的标志 |
| “2” |
tri_up |
类似奔驰的标志 |
| “3” |
tri_left |
类似奔驰的标志 |
| “4” |
tri_right |
类似奔驰的标志 |
| “8” |
octagon |
八角形 |
| “s” |
square |
正方形 |
| “p” |
pentagon |
五角星 |
| “*” |
star 星号 |
| “h” |
hexagon1 |
六边形1 |
| “H” |
hexagon2 |
六边形2 |
| “+” |
plus 加号 |
| “x” |
x |
x |
| “D” |
diamond |
钻石 |
| “d” |
thin_diamond |
细的钻石 |
| “ |
“ |
vline |
| “-“ |
hline |
水平方向的线 |
| “TICKLEFT” |
octagon |
像素 |
| marker |
type |
含义 |
| “.” |
point |
点 |
| “,” |
pixel |
像素 |
| “o” |
circle |
圆 |
| “v” |
triangle_down |
下三角 |
| “^” |
triangle_up |
上三角 |
| “<” |
triangle_left |
左三角 |
| “>” |
triangle_right |
右三角 |
| “1” |
tri_down |
类似奔驰的标志 |
| “2” |
tri_up |
类似奔驰的标志 |
| “3” |
tri_left |
类似奔驰的标志 |
| “4” |
tri_right |
类似奔驰的标志 |
| “8” |
octagon |
八角形 |
| “s” |
square |
正方形 |
| “p” |
pentagon |
五角星 |
| “*” |
star 星号 |
| “h” |
hexagon1 |
六边形1 |
| “H” |
hexagon2 |
六边形2 |
| “+” |
plus 加号 |
| “x” |
x |
x |
| “D” |
diamond |
钻石 |
| “d” |
thin_diamond |
细的钻石 |
| “ |
“ |
vline |
| “-“ |
hline |
水平方向的线 |
| “TICKLEFT” |
octagon |
像素 |
生成标签
plt.legend()