FOCUS AREAS

Graphics

Blood Pressure by Type
Base SAS: ODS Graphics Procedure: SGPLOT

%let gpath='.';
%let dpi=100;

ods html close;
ods listing gpath=&gpath image_dpi=&dpi style=listing;

/*--Blood Pressure as a Group--*/
data heart;
  keep Type Sex BP;
  length Type $10;
  set sashelp.heart;
  Type='Systolic'; BP=systolic; output;
  Type='Diastolic'; BP=diastolic; output;
run;

/*--Grouped Histogram--*/
ods graphics / reset width=5in height=3.75in noborder attrpriority=color 
               imagename='Grouped_Histogram';
title 'Blood Pressure by Type';
footnote j=l 'Grouped Histogram';
proc sgplot data=heart nowall noborder;
  histogram bp / group=type filltype=solid transparency=0.5 nbins=50 name='h';
  density bp / group=type;
  xaxis display=(nolabel noline) max=250;
  yaxis display=(noline noticks) grid offsetmin=0;
  keylegend 'h' / location=inside across=1 position=topright opaque;
  run;

title;
footnote;