运行 ❯
获取您自己的
Python
服务器
×
更改方向
更改主题,黑白
前往空间
#Three lines to make our compiler able to draw: import sys import matplotlib matplotlib.use('Agg') import numpy import matplotlib.pyplot as plt numpy.random.seed(2) x = numpy.random.normal(3, 1, 100) y = numpy.random.normal(150, 40, 100) / x train_x = x[:80] train_y = y[:80] test_x = x[80:] test_y = y[80:] plt.scatter(test_x, test_y) plt.show() #Two lines to make our compiler able to draw: plt.savefig(sys.stdout.buffer) sys.stdout.flush()