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.

 Respuesta aceptada

Star Strider
Star Strider el 10 de Ag. de 2020

0 votos

I am not certain what the problem is.
.

4 comentarios

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)
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 el 11 de Ag. de 2020
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 el 11 de Ag. de 2020
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Preguntada:

el 10 de Ag. de 2020

Comentada:

el 11 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by