Sample 49567: Overlay a scatter plot and a bar chart using the Graph Template Language (GTL)
The sample code on the Full Code tab uses the Graph Template Language (GTL) to overlay a scatter plot and a bar chart containing multiple response values for one or more categories successfully in the same cell. The program combines a BARCHART statement and a SCATTERPLOT statement within in the same LAYOUT OVERLAY block.
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.
The following program uses the Graph Template Language (GTL) to overlay a scatter plot and a bar chart containing multiple response values for one or more categories successfully in the same cell. The program combines a BARCHART statement and a SCATTERPLOT statement within in the same LAYOUT OVERLAY block.
data simple;
input Topic Sum Partial;
datalines;
1 50 24
1 30 10
2 75 10
3 40 37
3 12 19
4 100 75
5 60 40
;
run;
proc template;
define statgraph barscatter;
begingraph;
entrytitle 'Overlay Scatter Plot and Bar Chart';
layout overlay;
barchart x=Topic y=Sum;
scatterplot x=Topic y=Partial;
endlayout;
endgraph;
end;
run;
proc sgrender data=simple template=barscatter;
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.
This sample illustrates how to overlay a scatter plot and a bar chart using the Graph Template Language (GTL).
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGRENDER
|
Date Modified: | 2013-04-16 14:50:29 |
Date Created: | 2013-04-02 16:44:56 |
Operating System and Release Information
SAS System | SAS/GRAPH | Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
z/OS | 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 | |