您的位置:首页 > 编程语言 > Python开发

Python matplotlib通过plt.scatter画空心圆标记出特定的点方法

2018-12-13 20:03 2667 查看

在用python画散点图的时候想标记出特定的点,比如在某些点的外围加个空心圆,一样可以通过plt.scatter实现

import matplotlib.pyplot as plt

x = [[1, 3], [2, 5]]
y = [[4, 7], [6, 3]]

for i in range(len(x)):

plt.plot(x[i], y[i], color='r')
plt.scatter(x[i], y[i], color='b')
plt.scatter(x[i], y[i], color='', marker='o', edgecolors='g', s=200) # 把 corlor 设置为空,通过edgecolors来控制颜色

效果图

以上这篇Python matplotlib通过plt.scatter画空心圆标记出特定的点方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: