即使在我的代码中加入“ linespace = 'None' ”之后,图表上连接点的线也没有消失
Even after incorporating " linespace = 'None' " in my code, the lines joining up points on graph have not gone away
试图从我的图表中删除连接点的线,以便使用我自己的最佳拟合线。我在我的代码中使用了 linespace='None' 来绘制点。非常困惑为什么在 运行 代码之后这些行仍然存在。
任何帮助将不胜感激。
x_a = np.array(x) #defining x and y variables
y_a = np.array(y)
plt.errorbar(x, y, yerr = data) #plotting errorbars
plt.plot(x,y, ls='') #plotting x and y. Attempting to get rid of lines with ls=''
plt.show
台词仍来自 plt.errorbar
。两者都使用 ls=''
plt.errorbar(x, y, yerr=data, ls='')
plt.plot(x,y, ls='')
正如@DavidG 在评论中指出的那样,如果隐藏这些行,plt.plot(x,y, ls='')
将毫无用处。相反,除了误差条之外,您还可以使用散点图将数据点显示为
plt.scatter(x,y)
试图从我的图表中删除连接点的线,以便使用我自己的最佳拟合线。我在我的代码中使用了 linespace='None' 来绘制点。非常困惑为什么在 运行 代码之后这些行仍然存在。
任何帮助将不胜感激。
x_a = np.array(x) #defining x and y variables
y_a = np.array(y)
plt.errorbar(x, y, yerr = data) #plotting errorbars
plt.plot(x,y, ls='') #plotting x and y. Attempting to get rid of lines with ls=''
plt.show
台词仍来自 plt.errorbar
。两者都使用 ls=''
plt.errorbar(x, y, yerr=data, ls='')
plt.plot(x,y, ls='')
正如@DavidG 在评论中指出的那样,如果隐藏这些行,plt.plot(x,y, ls='')
将毫无用处。相反,除了误差条之外,您还可以使用散点图将数据点显示为
plt.scatter(x,y)