Matplotlib pyplot.plot()标记颜色

3

代码:

plt.plot(x,"g.")
plt.show()

生成:

在此输入图片描述

当我尝试以其他方式指定颜色时,会添加线条:

plt.plot(x,"darkgreen",marker=".")
plt.show()

enter image description here

我不需要这些线。除了单个字符代码之外,我如何使用颜色而不添加线条到图表中?
1个回答

4

linestyle设置为"None"

plt.plot(x,color="darkgreen",marker=".", linestyle="None")

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接