plotting error bars in both x and y data

Hi, i want to plot data set x vs y. Now i have different error values ​​in x and y. I want to plot error in both planes. The command error bar plots same error either horizontally, vertically or in both directions. But i want to plot different sets of errors in x and y. how can i do that. many thanks for your help.

 採用された回答

Star Strider
Star Strider 2020 年 8 月 10 日

0 投票

I am not certain what the problem is.
.

4 件のコメント

Sumera Yamin
Sumera Yamin 2020 年 8 月 10 日
lets suppose i have this simple set of data. this will plot me error bars either in horizontal or in vertical or in both, but with the same error in both directions. i want error bar in x and y according to err_x and err_y respectively. the error is plus-minus around the central value. I am not sure how can i control the length of error bars for this example.
x=[1:8];
y=[1:8];
err_x=[0.2,0.1,0.5,0.3,0.4,0.9,1.2,0.6];
err_y=[0.4,0.9,1.5,0.2,0.3,0.9,1.4,0.9];
plot(x,y)
hold on
errorbar(x,y,err_x,err_y)
Star Strider
Star Strider 2020 年 8 月 10 日
I would just do:
errorbar(x,y,err_y,err_y,err_x,err_x)
assuming that is the result you want.
Sumera Yamin
Sumera Yamin 2020 年 8 月 11 日
thankd for your comment. I noticed you took the error in y first and then the error in x. is this just to have the right direction in matlab?
Star Strider
Star Strider 2020 年 8 月 11 日
is this just to have the right direction in matlab?
That is how the errorbar documentation says to order them. Please read the documentation section I linked to in my original Answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by