在Python中,使用Matplotlib,如何绘制散点图empty绘制圆圈?目标是在周围画空圆圈some已经绘制的彩色圆盘scatter()
,以便突出显示它们,理想情况下无需重新绘制彩色圆圈。
I tried facecolors=None
,无济于事。
来自文档 http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter对于分散:
Optional kwargs control the Collection properties; in particular:
edgecolors:
The string ‘none’ to plot faces with no outlines
facecolors:
The string ‘none’ to plot unfilled outlines
请尝试以下操作:
import matplotlib.pyplot as plt
import numpy as np
x = np.random.randn(60)
y = np.random.randn(60)
plt.scatter(x, y, s=80, facecolors='none', edgecolors='r')
plt.show()
Note:对于其他类型的图,请参见这个帖子 https://stackoverflow.com/questions/10956903/how-to-make-hollow-square-marks-with-matplotlib-in-python关于使用markeredgecolor
and markerfacecolor
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)