我正在使用 pyplot.plot 生成散点图(而不是 scatter - 我在使用颜色图时遇到了困难)
我正在使用“o”标记来绘制一个圆圈,但圆圈总是有黑色轮廓。
如何去除轮廓,或调整其颜色?
最佳答案
要删除标记的轮廓并调整其颜色,请使用 markeredgewidth
(又名 mew
) , 和 markeredgecolor
(又名 mec
)。
使用 this as a guide :
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1)
y = np.sin(x)
plt.plot(x,
y,
color='blue',
marker='o',
fillstyle='full',
markeredgecolor='red',
markeredgewidth=0.0)
如您所见,即使设置了标记边缘颜色,因为它的宽度设置为零,它也不会显示。
关于python - 在 matplotlib 中使用 pyplot.plot 时如何删除圆形标记的轮廓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28403179/