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!