%let gpath='C:\'; %let dpi=200; ods html close; ods listing gpath=&gpath image_dpi=&dpi; /*--Simple Layout Only--*/ proc template; define statgraph Simple_Layout; begingraph; entrytitle 'Blood Pressure'; layout lattice / columns=2 columngutter=5; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=weight y=systolic / markerattrs=(size=0); entry halign=center textattrs=(size=20) "1" / valign=center; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=weight y=diastolic / markerattrs=(size=0); entry halign=center textattrs=(size=20) "2" / valign=center; endlayout; endlayout; endgraph; end; run; ods graphics / reset width=5in height=3in imagename='Simple_Layout'; proc sgrender data=sashelp.heart template=Simple_Layout; run; /*--Simple Layout With Graphs--*/ proc template; define statgraph Simple_Layout_Graphs; begingraph; entrytitle 'Blood Pressure by Weight and Sex'; layout lattice / columns=2 columngutter=5; layout overlay / xaxisopts=(griddisplay=on) yaxisopts=(griddisplay=on); scatterplot x=weight y=systolic / group=sex name='s'; discretelegend 's'; endlayout; layout overlay / xaxisopts=(griddisplay=on) yaxisopts=(griddisplay=on); scatterplot x=weight y=diastolic / group=sex name='d'; discretelegend 'd'; endlayout; endlayout; endgraph; end; run; ods graphics / reset width=5in height=3in imagename='Simple_Layout_Graphs'; proc sgrender data=sashelp.heart template=Simple_Layout_Graphs; run; /*--Layout With Common Axis, Headers and Sidebar--*/ proc template; define statgraph Layout_CommonAxis_Sidebar; begingraph; entrytitle 'Blood Pressure by Weight and Sex'; layout lattice / columns=2 columngutter=5 rowdatarange=union; rowaxes; rowaxis / griddisplay=on label='Blood Pressure'; endrowaxes; column2headers; entry 'Systolic'; entry 'Diastolic'; endcolumn2headers; layout overlay / xaxisopts=(griddisplay=on); scatterplot x=weight y=systolic / group=sex name='s'; endlayout; layout overlay / xaxisopts=(griddisplay=on); scatterplot x=weight y=diastolic / group=sex name='d'; endlayout; sidebar / spacefill=false; discretelegend 'd'; endsidebar; endlayout; endgraph; end; run; ods graphics / reset width=5in height=3in imagename='Layout_CommonAxis_Sidebar'; proc sgrender data=sashelp.heart template=Layout_CommonAxis_Sidebar; run; /*--Complex Layout Only--*/ proc template; define statgraph Complex_Layout; begingraph; layout lattice / columns=2 columnweights=(.6 .4) columngutter=5; layout lattice / rows=4 rowweights=(.25 .2 .2 .35) rowgutter=5; layout lattice / columns=2 rowweights=(.6 .4) columngutter=5; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "1" / valign=center; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "2" / valign=center; endlayout; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "3" / valign=center; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "4" / valign=center; endlayout; layout lattice / columns=2 rowweights=(.6 .4) columngutter=5; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "5" / valign=center; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "6" / valign=center; endlayout; endlayout; endlayout; layout overlay / walldisplay=(outline) xaxisopts=(display=none) yaxisopts=(display=none); scatterplot x=height y=weight / markerattrs=(size=0); entry halign=center textattrs=(size=20) "7" / valign=center; endlayout; endlayout; endgraph; end; run; ods graphics / reset width=5in height=5in imagename='Complex_Layout'; proc sgrender data=sashelp.class template=Complex_Layout; run;