Plotting errorbars of multiple datasets- Please help
Plotting errorbars of multiple datasets- Please help
(OP)
Hello everyone
I have been trying to plot multiple data sets (actually mean of 1000 simulation results) and their standard deviations on the same graph for some time now. However I havent been able to find a decent way of doing this. Currently I know i can plot:
1) multiple datasets using the plot(X1,mean(Y1),'b*',X2,mean(Y2),'r+-'.....) scheme or
2) plot a single dataset's mean and stdDev using errorbar(X1, mean(Y1),std(Y1)).
but i cant plot two the sets together! (I also want to give different color and legend names to each of them).
Can any body give me the best way to do this?
I have been trying to plot multiple data sets (actually mean of 1000 simulation results) and their standard deviations on the same graph for some time now. However I havent been able to find a decent way of doing this. Currently I know i can plot:
1) multiple datasets using the plot(X1,mean(Y1),'b*',X2,mean(Y2),'r+-'.....) scheme or
2) plot a single dataset's mean and stdDev using errorbar(X1, mean(Y1),std(Y1)).
but i cant plot two the sets together! (I also want to give different color and legend names to each of them).
Can any body give me the best way to do this?





RE: Plotting errorbars of multiple datasets- Please help
Arrange, for example, your data sets in cell array.
Create a cell array of color spec:
Col={'k' 'b' 'c' 'r' 'y' 'm'}
Then loop:
for n =1:N
errorbar(X{n},Y{n},e{n},Col{n});
hold on
end
legend('series 1','series2;,'series 3', ...)
Joe Sababa
BSTeX - Equation viewer for Matlab
http://www.geocities.com/bstex2001/
Joe
BSTeX- Equation viewer for Matlab
http://www.geocities.com/bstex2001