当我使用 plt.errorbars 时,我希望灰点根本不会出现在空心圆圈符号内。我发现了一个类似的问题,但它使用了 ggplot。
除非别无选择,否则我想坚持使用 pyplot。我的代码如下。提前致谢。
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,5,0.1)
y = np.sin(x)
yerr = np.random.randint(2,size=len(x))
plt.errorbar(x,y,yerr=yerr, color='gray', fmt='.', zorder=1)
plt.plot(x,y,'ro', mfc='none', label='My work')
plt.legend(numpoints=1)
plt.show()