W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
# 这三行代码让编译器能够绘图: import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np # 创建 y 轴数据点数组 ypoints = np.array([3, 8, 1, 10]) # 绘制折线图,使用圆形标记(大小 20) plt.plot(ypoints, marker = 'o', ms = 20) plt.show() # 这两行代码让编译器能够输出图形: plt.savefig(sys.stdout.buffer) sys.stdout.flush()