1.MatplotlibDeprecationWarning
plt.scatter(x,y, marker='s',edgecolors='purple',c="",s=150)
这个画图不难,主要是遇到一个问题,上面的代码总是报警告:
MatplotlibDeprecationWarning: Using a string of single character colors as a color sequence is deprecated since 3.2 and will be removed two minor releases later. Use an explicit list instead.
这个占用终端的行数,每次运行都输出很多行。
2. 画图改进
plt.scatter(x, y, marker='s', edgecolors=['purple'],c="none",s=150)
这样就没有警告了。
3.参考资料
Matplotlib scatter plot of unfilled squares
还是StackOverflow靠谱啊~~~