Graphics

Base SAS: ODS Graphics Procedure: SGPLOT
/* This program requires SAS 9.4 TS Level 1M2 or later */
%let gpath='.';
%let dpi=100;
/*--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;
ods html close;
/*--Grouped Histogram--*/
ods listing gpath=&gpath image_dpi=&dpi style=listing;
ods graphics / reset width=5in height=3.75in 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;