Having problems when plotting errorbars
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!