Difference between errorbar and errorbarxy (function)

2 visualizaciones (últimos 30 días)
Nik Rocky
Nik Rocky el 5 de Jul. de 2020
Comentada: Nik Rocky el 6 de Jul. de 2020
Hello,
I'm calculating and plotting a mean-Values and standard deviation:
If I plot it via errorbar, I get:
....
errorbar(M1(:,2),M1(:,1),S1(:,2),S1(:,1),'-o','both','LineWidth',1.5,'MarkerFaceColor','cyan','MarkerSize',10,'MarkerEdgeColor','black','DisplayName',label1{1})
....
errorbar(M2(:,2),M2(:,1),S2(:,2),S2(:,1),'-s','both','LineWidth',1.5,'MarkerFaceColor','yellow','MarkerSize',10,'MarkerEdgeColor','black','DisplayName',label2{1})
...
If I plot with errorbarxy function, I get:
errorbarxy(M1(:,2),M1(:,1),S1(:,2),S1(:,1))
....
errorbarxy(M1(:,2),M1(:,1),S1(:,2),S1(:,1))
....
Why, I'm getting different line length? I tnink an errorplot has a wrong length, because there are each one value for x-axis and y-axis?! What is the better way to plot main + std?
values are:
M1 =
0.0570 0.9098
0.0860 0.8615
0.7741 0.1542
0.9682 0.0200
0.9874 0.0016
M2 =
0.0591 0.9049
0.2164 0.7222
0.7954 0.1332
0.9703 0.0091
0.9761 0.0082
S1 =
0.0196 0.0220
0.0356 0.0585
0.0349 0.0636
0.0354 0.0347
0.0027 0.0027
S2 =
0.0323 0.0461
0.2140 0.2619
0.2021 0.1885
0.0216 0.0158
0.0171 0.0141
  4 comentarios
dpb
dpb el 6 de Jul. de 2020
>> which -all errorbar
C:\ML_R2019b\toolbox\matlab\specgraph\errorbar.m
errorbar is a built-in method % tall method
>> which -all errorbarxy
'errorbarxy' not found.
>>
errorbarxy is NOT a TMW-supplied function but there is one for the job; my recommendation is to use it.
The FEX submission may be just perfectly fine, but why throw confusion between two functions that may have chosen different input arrangements into the mix besides?
Nik Rocky
Nik Rocky el 6 de Jul. de 2020
Sorry, it was to late and my brain was down.
I have a solution with standard errobar:
errorbar(M2(:,2),M2(:,1),S2(:,2),S2(:,2),S2(:,1),S2(:,1),'-s','LineWidth',1.5,'MarkerFaceColor','yellow','MarkerSize',10,'MarkerEdgeColor','black','DisplayName',label2{1})
I have to define xpos and xneg, ypos and yneg
So just scribe the same two times =)

Iniciar sesión para comentar.

Respuesta aceptada

the cyclist
the cyclist el 6 de Jul. de 2020
See this example from the documentation for errorbar.
  1 comentario
Nik Rocky
Nik Rocky el 6 de Jul. de 2020
Yes, thank you! I solve it by writing two time a values for xpos and xneg, ypos and yneg =)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Errorbars en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by