Emm*_*ith 5 python matplotlib errorbar
我无法在我的数据点之间获取这些线条消失!似乎每当我尝试添加错误栏时它就会这样做.如果你看图表,第一个没有错误栏行,第二个是它.这是pyplot errorbar的常见副作用吗?有谁知道为什么会这样做,或者如何让它消失?
plt.figure()
plt.scatter(x, y, label = 'blah')
plt.errorbar(x, y, yerr = None, xerr = x_err)
plt.plot(x, f) #this is a line of best fit
Run Code Online (Sandbox Code Playgroud)
Bar*_*art 14
您可以将线条样式(ls)设置为none:
import numpy as np
import matplotlib.pylab as plt
x = np.arange(10)
y = np.arange(10)
yerr = np.random.random(10)
xerr = np.random.random(10)
plt.figure()
plt.subplot(121)
plt.scatter(x, y, label = 'blah')
plt.errorbar(x, y, yerr = None, xerr = xerr)
plt.subplot(122)
plt.scatter(x, y, label = 'blah')
plt.errorbar(x, y, yerr = None, xerr = xerr, ls='none')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7005 次 |
| 最近记录: |