Wednesday, July 16, 2014

Display different boxplot groups on the same figure in MATLAB

a Simple example of how you could put the groups of boxplot together. Both of the data groups are in defined in one matrix .

 data = rand(20,24)  
 month = repmat({'jan' 'feb' 'mar' 'apr' 'may' 'jun' 'jul' 'aug' 'sep' 'oct' 'nov' 'dec'},1,2);  
 simobs = [repmat({'sim'},1,12),repmat({'obs'},1,12)];  
 boxplot(data,{month,simobs},'colors',repmat('rb',1,12),'factorgap',[5 2],'labelverbosity','minor');  



Here is the figure:

No comments:

Post a Comment