Matplotlib (plt) plots graphics

import matplotlib.pyplot as plt

# 示例数据
x = [1, 2, 3, 4, 5]
y = [10, 20, 15, 30, 25]

# 绘制折线图
plt.plot(x, y)

# 设置图形标题
plt.title("示例折线图")  # 在这里设置图形的标题

# 设置 x 轴和 y 轴的标签
plt.xlabel("X轴")
plt.ylabel("Y轴")

# 显示图形
plt.show()

Guess you like

Origin blog.csdn.net/qq_45410037/article/details/131900093