python画图 图例 颜色 线宽

 今天不太想整理,贴一下代码。

plt.figure()
plt.plot(range(0, len(flow_in)), [float(flow_in[i]) for i in range(0, len(flow_in))], label="flow_in", color='r', linewidth=2)
plt.plot(range(0, len(flow_out)), flow_out, label='flow_out', color='g', linewidth=2)
plt.plot(range(0, len(dwell)), dwell, label='dwell', color='b', linewidth=2)
plt.legend(loc='upper left')
plt.title(region_name)
plt.show()

猜你喜欢

转载自blog.csdn.net/ncc1995/article/details/84918455