/****************************************************************************** * Programme : Visualisation avancée avec SGPANEL et mises en page Lattice * Reference : VISUALAF16 * Source : https://www.wearecas.eu/en/sampleCode/VISUALAF16 ******************************************************************************/ /* --- BLOC 1 --- */ %let gpath='.'; %let dpi=200; ods html close; ods listing gpath=&gpath image_dpi=&dpi; data heart; set sashelp.heart(where=(deathcause ne 'Unknown' and deathcause ne 'Other')); run; /* --- BLOC 2 --- */ ods graphics / reset attrpriority=color width=4in height=4in imagename='RowLattice'; title 'Distribution of Cholesterol by Death Cause'; proc sgpanel data=heart noautolegend; panelby deathcause / layout=rowlattice onepanel novarname spacing=10; histogram cholesterol; density cholesterol; rowaxis offsetmin=0; colaxis max=420; run; /* --- BLOC 3 --- */ ods graphics / reset attrpriority=color width=4in height=4in imagename='RowLatticeInset'; title 'Distribution of Cholesterol by Death Cause'; proc sgpanel data=heart noautolegend; panelby deathcause / layout=rowlattice onepanel noheader spacing=10; inset deathcause / position=topleft nolabel; histogram cholesterol; density cholesterol; rowaxis offsetmin=0; colaxis max=420; run; /* --- BLOC 4 --- */ ods graphics / reset attrpriority=color width=4in height=4in imagename='RowLatticeInset2'; title 'Distribution of Cholesterol by Death Cause'; proc sgpanel data=heart noautolegend; panelby deathcause / layout=rowlattice onepanel noheader spacing=10; inset deathcause / position=topleft nolabel backcolor=silver; histogram cholesterol; density cholesterol; rowaxis offsetmin=0; colaxis max=420; run; /* --- BLOC 5 --- */ ods graphics / reset attrpriority=color width=4in height=4in imagename='LatticeInset'; title 'Distribution of Cholesterol by Death Cause'; proc sgpanel data=heart noautolegend; panelby sex deathcause / layout=lattice onepanel noheader spacing=10; inset deathcause sex / position=topleft nolabel; histogram cholesterol; density cholesterol; rowaxis offsetmin=0 offsetmax=0.15; colaxis max=420; run;