首页 > 编程 > Python > 正文

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

2019-11-25 13:40:40
字体:
来源:转载
供稿:网友

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

import matplotlib.pyplot as pltx = [[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画空心圆标记出特定的点

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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表