BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I have an interesting challenge with TEMPLATE.  I am trying to create a lattice where each plot within the lattice is a panel of graphs. For a single panel of graphs, I can easily do this with SGPANEL, but I need to make a single figure with several different panels. The following TEMPLATE code works just fine to create a 1x4 panel of graphs (instead of using SGPANEL):

 
proc template; 
 define statgraph test12;
 begingraph;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
        layout prototype;
        bandplot x=year limitupper=uclmarg limitlower=lclmarg ;    
       seriesplot x=year y=y / lineattrs=graphFit ;
       scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
    endlayout;    
endlayout;
endgraph;
end;
run;
I would like to wrap the equivalent of a "LAYOUT LATTICE" around this to have several rows, where each row is a panel of four (or whatever) graphs (with a different response variable for each row). I realize that LAYOUT LATTICE does not allow for DATAPANEL, so I am looking for a workaround. For instance, I would like to use something like:
proc template; 
 define statgraph test12;
 begingraph;
layout lattice / columns=1 rows=3;
   layout datapanel classvars=(type _trt) / rows=1 columns=4;
        layout prototype;
        bandplot x=year limitupper=uclmarg limitlower=lclmarg ;    
       seriesplot x=year y=p / lineattrs=graphFit ;
       scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
     endlayout;
   layout datapanel classvars=(type _trt) / rows=1 columns=4;
        layout prototype;
        bandplot x=year limitupper=uclmarg2 limitlower=lclmarg2 ;    
       seriesplot x=year y=p2 / lineattrs=graphFit ;
       scatterplot x=year y=y2 / markerattrs=(size=8px color=blue symbol=circlefilled) ;
    endlayout;
 endlayout;
....
endlayout;
endgraph;
end;
run;

Any recommendations on how to do this? Thanks. 
LVM
1 ACCEPTED SOLUTION
2 REPLIES 2

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 366 views
  • 2 likes
  • 2 in conversation