Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plotting errorbars of multiple datasets- Please help

Status
Not open for further replies.

intiha

Computer
Dec 1, 2004
1
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?



 
Replies continue below

Recommended for you

Hi,
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

Joe
BSTeX- Equation viewer for Matlab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor