python誤差棒圖errorbar()函數(shù)實例解析
這篇文章主要介紹了python誤差棒圖errorbar()函數(shù)實例解析,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
函數(shù)功能:繪制y軸方向或是x軸方向的誤差范圍。
調(diào)用簽名:plt.errorbar(x, y, yerr=a, xerr=b)
x:數(shù)據(jù)點的水平位置
y:數(shù)據(jù)點的垂直位置
yerr:y軸方向的數(shù)據(jù)點的誤差計算方法
xerr:x軸方向的數(shù)據(jù)點的誤差計算方法
代碼實現(xiàn):
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0.1, 0.6, 6) y = np.exp(x) plt.errorbar(x, y, fmt="bo:", yerr=0.2, xerr=0.02) plt.xlim(0, 0.7) plt.show()
結(jié)果

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- 解決python多線程報錯:AttributeError: Can''t pickle local object問題
- python使用pip安裝模塊出現(xiàn)ReadTimeoutError: HTTPSConnectionPool的解決方法
- Python BeautifulSoup [解決方法] TypeError: list indices must be integers or slices, not str
- python中報錯"json.decoder.JSONDecodeError: Expecting value:"的解決
- Python中出現(xiàn)IndentationError:unindent does not match any outer indentation level錯誤的解決方法
- 解決python報錯MemoryError的問題
- Python UnicodeEncodeError: ''gbk'' codec can''t encode character 解決方法
- Python發(fā)起請求提示UnicodeEncodeError錯誤代碼解決方法
相關(guān)文章
Python OpenCV調(diào)用攝像頭檢測人臉并截圖
這篇文章主要為大家詳細介紹了Python OpenCV調(diào)用攝像頭檢測人臉并截圖,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-07-07

