import torch
import matplotlib.pyplot as plt
x=torch.unsqueeze(torch.linspace(-1,1,100),dim=1)
y=x.pow(2)+0.2*torch.rand(x.size())
# plt.scatter(x.data.numpy(),y.data.numpy()) #绘制散点
# plt.plot(x.data.numpy(),y.data.numpy()) #绘制过点的线
# plt.show()
scatter:(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, hold=None, data=None, **kwargs)
根据x, y坐标,绘制散点;可更改点的颜色(c)、大小(s)、形状(marker)等,参数已列出,