MATLAB Answers

How can I plot 2 graphs with errorbar each one?

12 views (last 30 days)
Jonathan Bijman
Jonathan Bijman on 13 Jun 2019
Commented: Jonathan Bijman on 13 Jun 2019
Dear community
I'm plotting 2 graphs and I want to put errorbar in each plot.
How can I do that?
Thanks!

  0 Comments

Sign in to comment.

Accepted Answer

dpb
dpb on 13 Jun 2019
Use errorbar and hold on or as per the documentation, if y is a matrix errorbar plots a separate line for each column.

  4 Comments

Show 1 older comment
Jonathan Bijman
Jonathan Bijman on 13 Jun 2019
Please light me with your wisdom @Walter Roberson =(
dpb
dpb on 13 Jun 2019
Why are you using plot to draw the same data as are drawn with errorbar?
x = linspace(0, 50, numel(Voc_C)); % x points vector (row)
X = [x;x].'; % 2-column X to plot against
Y = [Voc_C(:) Voc_D(:)]; % 2-column Y to plot
err=[Voc_desv_C(:) Voc_desv_D(:)]; % 2-column error to plot
errorbar(X,Y,err)
title('Voc Plot')
xlabel('Tiempo (Días)')
ylabel('Voc (V)')
legend('Voc Clean','Voc Dirty');

Sign in to comment.

More Answers (0)

Tags