[英]Scatter plot with infinitesimal point size in Python
您可以通过设置marker='.'
将marker='.'
更改为点marker='.'
,然后通过使用linewidths=0
删除轮廓来进一步减小其大小。 请注意, markeredgewidth
不适用于scatter
。
考虑这个例子。 如您所见,绘制的点的最后一行( marker='.', s=1, linewidths=0
)给出最小的标记:
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(1)
x = np.linspace(0, 10, 100)
ax.scatter(x, np.ones_like(x)+0, marker='o', s=1, color='k')
ax.scatter(x, np.ones_like(x)+1, marker='o', s=1, color='k', linewidths=0)
ax.scatter(x, np.ones_like(x)+2, marker='.', s=1, color='k')
ax.scatter(x, np.ones_like(x)+3, marker='.', s=1, color='k', linewidths=0)
plt.show()
在散点图中,点具有标记,该标记是一个符号,例如圆形,并且该符号也具有边框。 我认为边框默认是打开的。 尝试关闭钻孔,例如将其宽度设置为0。
http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D.set_markeredgewidth
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.