标签:style doc alpha war class lis problem plot cut
见https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.scatter.html
matplotlib.pyplot.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)
原文summarize的很好:
x
vs y
.s
and marker color is mapped to c。
我的应用案例
import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap plt.figure() plt.title(‘Sample regression problem with one input variable‘) #黄绿蓝 cmap_bold = ListedColormap([‘#FFFF00‘, ‘#00FF00‘, ‘#0000FF‘]) plt.scatter(XTrain[:,0], XTrain[:,1], c=yTrain,marker= ‘o‘, s=50, cmap=cmap_bold) plt.show()
结果显示
plot的目的是想通过数据观察特征,选取特征,之后还会进行更多对特征的分析
标签:style doc alpha war class lis problem plot cut
原文地址:http://www.cnblogs.com/sss423/p/7493488.html