美文网首页
python 画折线图

python 画折线图

作者: cggl | 来源:发表于2020-08-19 15:40 被阅读0次

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()

相关文章

网友评论

      本文标题:python 画折线图

      本文链接:https://www.haomeiwen.com/subject/ontdjktx.html