Having problems when plotting errorbars

조회 수: 3 (최근 30일)
Guillermo Lopez
Guillermo Lopez 2012년 6월 6일
Hi everyone. I have some problems when plotting errorbars on my graph. I have a figure which I have plotted using subplot:
subplot (5,3,[10,13]); %here goes the axis with the real parts
hold on
plot(theory_data(1:100,1),theory_data(1:100,2));
plot(real_data(1:9,2),real_data(1:9,1),'o');
title('Theory vs calculated nflake_re');
xlabel('wavelength(nm)');
ylabel('real part refractive index');
I define error as error_calculation=0.3 (a random value of my error). To put my errorbar therefore I write as stated in matlab help (errorbar(X,Y,E)) under the ylabel line of code:
errorbar (real_data(1:9,2),real_data(1:9,1),error_calculation);
This way when I run the code, I only get a line on the left of my graph (on top of the actual y axis) but not on the actual data points (where i want the error bars). So my question is; why is this happening? Am I doing something wrong? My data points are taken from a table with a column for the x values (real_data (1:9,2) and a column for the y values (1:9,1).
Thanks in advance

답변 (0개)

카테고리

Help CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by