Sample 59322: How to nest a graph within a graph
The sample code on the Full Code tab illustrates how to nest a graph within a graph using Graph Template Language (GTL). For details, refer to the blog
Picture-in-Picture - It's Not Just for Television Anymore.
Note: The FILLPATTERN option and the DISPLAY option FILLPATTERN are available beginning in the first maintenance release of SAS® 9.4 (TS1M1). If you are running an earlier release of SAS, you need to remove this syntax from the program.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
proc template;
define statgraph inset;
begingraph;
entrytitle 'Framingham Heart Study';
layout overlay;
histogram cholesterol / binaxis=false datatransparency=0.5
display=(fillpattern outline fill) fillattrs=(color=lightred)
fillpatternattrs=(pattern=l3 color=red);
densityplot cholesterol / datatransparency=0.5 lineattrs=(color=darkred);
layout gridded / width=300px height=200px halign=right valign=top;
layout overlay / yaxisopts=(label='Blood Pressure' linearopts=(thresholdmax=1))
xaxisopts=(linearopts=(thresholdmax=1));
regressionplot x=cholesterol y=diastolic / lineattrs=(color=blue pattern=2) name='Diastolic';
regressionplot x=cholesterol y=systolic / lineattrs=(color=green) name='Systolic';
discretelegend 'Diastolic' 'Systolic' / across=2;
endlayout;
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.heart template=inset;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGRENDER Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Template Language (GTL) Query and Reporting ==> Report Distribution Query and Reporting
|
Date Modified: | 2016-11-29 15:07:19 |
Date Created: | 2016-11-10 15:13:35 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
z/OS 64-bit | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Windows Vista for x64 | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |