ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

matplotlib plot 折线图使用体验

2026/8/10 19:01:01 拓冰建站 浏览量
matplotlib plot 折线图使用体验

matplotlib plot 折线图使用体验

plot 只是默认情况下指代折线图,本身 plot 其实是 所有图标都可以表示。

效果图

image

代码

import matplotlib.pyplot as plt
import numpy as np  # 存在感没有很高# x 和 y 需要一一对应
xpoints = [0, 6, 12] 
ypoints = [0, 100, 0]plt.plot(xpoints, ypoints)
plt.show()