title: endpoint histogram SAS sgplot
body: <p>I am trying to modify a histogram in SAS proc sgplot so that the bins are not graphically centered at the midpoint.  Rather, I would like them to be from 0 to 5, 5 to 10, etc.  The way this graph is currently, I get this weird "half bar" at 0--it's not the right thickness and it looks strange.</p>
  
  <p>I'm not tied to using sgplot, I could use univariate or proc template if I can still get the desired overlaid histograms.  Here is my data:</p>
  
  <pre><code>data have;
      input x y;
  cards;
  1 . 
  5 .  
  6 . 
  20 . 
  13 . 
  4 . 
  2 . 
  2 . 
  7 . 
  4 . 
  17 . 
  33 . 
  2 . 
  . 2 
  . 15 
  . 4 
  . 10 
  . 35 
  . 20 
  . 6 
  . 14
  ;
  run;
  
  proc sgplot data=have;
      histogram x /  fillattrs=graphdata1 name='s' legendlabel='x' 
                         transparency=0.5 binstart=0 binwidth=5; 
      histogram y / fillattrs=graphdata2 name='d' legendlabel='y' 
                         transparency=0.5  binstart=0 binwidth=5; 
      keylegend 's' 'd' / location=inside position=topright across=1;
      xaxis display=(nolabel) label='label' min=0 max=40;
   run;
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>Pyll</p>