title: How to scale each different sized bars to fill the plot in Stacked Barh?
body: <p>I would like to make a visually good plot with horizontal stacked bar. My goal is to fill the area horizontally with each bars. If each sum of rows in the matrix would be equal, the result is fine, i would like exactly that one with different sum-value rows.</p>
  
  <p>I can set the max value of a dataset to xlim.</p>
  
  <p><strong>But how can I stretch or scale the different sum-value-stackedbars?</strong></p>
  
  <p>Bar values are currently in the a bars, so the focus is on the visual appearence.</p>
  
  <p>I would appreciate any help you could provide.</p>
  
  <p><em>Here is an example dataset for the problem;</em></p>
  
  <pre><code>t = [2 19 10 0;2 17 13 0;2 14 17 0;0 14 18 2;1 11 22 1;0 15 19 2;1 12 23 1;1 16 20 1;1 20 16 1];
  barh(t,'stacked');
  
  for i = 1 : 9
      num(i) = sum(t(i,:));
  end
  xlim = max(num);
  
  set(gca,'XLim',[0 xlim]);
  </code></pre>