| LAYOUT LATTICE Statement |
The following graph was generated by the "Example Program":

proc template;
define statgraph layoutlattice;
begingraph;
entrytitle "Vehicle Gas Mileage";
entryfootnote "Averages of 428 models from 38 manufactures";
layout lattice / columns=2 rowdatarange=union;
layout overlay / cycleattrs=true;
barchart x=origin y=mpg_highway /
stat=mean barwidth=.8 name="H" ;
barchart x=origin y=mpg_city /
stat=mean barwidth=.5 name="C" ;
endlayout;
layout overlay / cycleattrs=true;
barchart x=type y=mpg_highway /
stat=mean barwidth=.8;
barchart x=type y=mpg_city /
stat=mean barwidth=.5;
endlayout;
sidebar / align=top;
discretelegend "H" "C" / border=false;
endsidebar;
rowaxes;
rowaxis / display=(tickvalues)
displaysecondary=(tickvalues) griddisplay=on;
endrowaxes;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.cars template=layoutlattice;
run;
When the data-range scales are unified, you can simplify the layout by displaying only the external axes that apply to all of the graphs across the corresponding columns or rows. See "Axis Statements" for more details.
The following figure shows the parts of the Lattice layout with the default axis display (internal axes are displayed).

This next figure shows the parts of the Lattice layout when the graph display is simplified so that only external axes are displayed.

The columns and rows can be separated by areas called gutters , which are controlled by the COLUMNGUTTER= and ROWGUTTER= options. In addition, the COLUMNWEIGHTS= and ROWWEIGHTS= options can be used to allocate a proportion of available space to each row and column.
The LATTICE layout automatically decides how much area to allocate to cell contents:
The layout's grid size is determined by the COLUMNS= and ROWS= options.
By default, the results of the statgraph-statements are placed into the grid sequentially from left to right, wrapping to a new row each time the current row is filled. You can use the ORDER= option to fill cells from top to bottom down a column, in which case the layout cells wrap to a new column each time the current column is filled.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.