import random
import matplotlib as mpl
import matplotlib.pyplot as plt
x_data = range(0, 100)
values1 = []
values2 = []
for i in range(0, 100):
values1.append(random.randint(0, 100))
for i in range(0, 100):
values2.append(random.randint(10, 150))
plt.figure(figsize=(9, 3))
plt.subplot(111)
plt.plot(x_data, values1, linewidth='1', label="test", color='coral', linestyle=':', marker='|')
mpl.rcParams['lines.linewidth'] = 5.0 # 线条属性也可以这么设置
plt.plot(x_data, values2, color="#007854")
plt.show()
marker styles
character description
================ ===============================
- solid line style
-- dashed line style
-. dash-dot line style
: dotted line style
. 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
*