import matplotlib.pyplot as plt # 示例数据 x = [1, 2, 3, 4, 5] y = [2, 4, 1, 5, 3] # 绘制折线图 plt.plot(x, y) # 添加标题和轴标签 plt.title("Example Plot") plt.xlabel("X Axis") plt.ylabel("Y Axis") # 显示图形 plt.show()