title: Single boxplot for multiple group comparison
body: <p>Here is the sample code that i used to compare two groups with random mean and standard deviation. However, i want to plot both groups in a single box in the box plot as shown in the attached figure where x-axis is group 1 and y-axis is group 2. I could not find any code doing this. Can some one please help me with this?</p>
  
  <pre><code>    clc 
  clear 
  
  x=[rand(1,10) rand(1,10) rand(1,10) rand(1,10) rand(1,10) rand(1,10)]; 
  n=10 ; xx=([1:6])'; % example 
  r=repmat(xx,1,n)'; 
  g=r(:)'; 
  
  
  positions = [1 2 3 4 5 6 ]; 
  h=boxplot(x,g, 'positions', positions); 
  set(h,'linewidth',2) 
  
  set(gca,'xtick',[mean(positions(1:2)) mean(positions(3:4)) mean(positions(5:6)) ]) 
  set(gca,'xticklabel',{'exp1','exp2','exp3'},'Fontsize',28) 
  
  color = ['c', 'y', 'c', 'y','c', 'y']; 
  h = findobj(gca,'Tag','Box'); 
  for j=1:length(h) 
  patch(get(h(j),'XData'),get(h(j),'YData'),color(j),'FaceAlpha',.5); 
  end 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/cLTC6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cLTC6.jpg" alt="enter image description here"></a></p>
  
  <p>now i want yellow and blue for exp1 in one box as shown below.. similarly for exp2 and exp3 so on.. so 3 boxes in one boxplot..Ideally this should work for any number of experiments.</p>
  
  <p><a href="https://i.stack.imgur.com/feFBN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/feFBN.jpg" alt="enter image description here"></a></p>