maker 取值
'.': point marker
',': pixel marker
'o': circle marker
'v': triangle_down marker
'^': triangle_up marker
'<': triangle_left marker
'>': triangle_right marker
'1': tri_down marker
'2': tri_up marker
'3': tri_left marker
'4': tri_right marker
's': square marker
'p': pentagon marker
'*': star marker
'h': hexagon1 marker
'H': hexagon2 marker
'+': plus marker
'x': x marker
'D': diamond marker
'd': thin_diamond marker
'|': vline marker
'_': hline marker
最常见的代码
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2 * np.pi, 10)
y1, y2 = np.sin(x), np.cos(x)
plt.plot(x, y1, marker='o', mec='r', mfc='w')
plt.plot(x, y2, marker='*', ms=10)
plt.show()
网友评论