Sample 52962: Create a spaghetti plot with the Graph Template Language (GTL)
The sample code on the
Full Code tab illustrates how to produce a "spaghetti plot" with the Graph Template Language (GTL). The syntax in this program requires the second maintenance release of SAS
® 9.4 (TS1M2).
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 sample code below illustrates how to produce a "spaghetti plot" with the Graph Template Language (GTL). The syntax in this program requires the second maintenance release of SAS
® 9.4 (TS1M2).
data one;
input trt_group time subject results;
datalines;
1 2 100 20
1 4 100 30
1 6 100 35
1 8 100 50
1 2 200 40
1 4 200 25
1 6 200 40
1 8 200 30
1 2 300 25
1 4 300 40
1 6 300 45
1 8 300 55
2 2 400 15
2 4 400 35
2 6 400 50
2 8 400 45
2 2 500 35
2 4 500 35
2 6 500 20
2 8 500 35
;
run;
proc template;
define statgraph grouping;
begingraph;
entrytitle 'Study Results by Treatment Group';
layout overlay;
seriesplot x=time y=results / group=subject linecolorgroup=trt_group name='grouping';
discretelegend 'grouping' / type=linecolor;
endlayout;
endgraph;
end;
proc sgrender data=one template=grouping;
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: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Template Language (GTL) SAS Reference ==> Procedures ==> SGRENDER
|
Date Modified: | 2014-06-06 16:21:18 |
Date Created: | 2014-05-12 13:49:25 |
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for x64 | 9.4 TS1M2 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M2 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M2 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M2 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M2 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M2 | |
Microsoft Windows 8.1 Pro | 9.4 TS1M2 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M2 | |
Microsoft Windows Server 2008 | 9.4 TS1M2 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M2 | |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M2 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M2 | |
z/OS | 9.4 TS1M2 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M2 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M2 | |
Z64 | 9.4 TS1M2 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M2 | |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M2 | |
Microsoft Windows Server 2012 Std | 9.4 TS1M2 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M2 | |
Windows 7 Enterprise x64 | 9.4 TS1M2 | |
Windows 7 Home Premium 32 bit | 9.4 TS1M2 | |
Windows 7 Home Premium x64 | 9.4 TS1M2 | |
Windows 7 Professional 32 bit | 9.4 TS1M2 | |
Windows 7 Professional x64 | 9.4 TS1M2 | |
Windows 7 Ultimate 32 bit | 9.4 TS1M2 | |
Windows 7 Ultimate x64 | 9.4 TS1M2 | |
64-bit Enabled AIX | 9.4 TS1M2 | |
64-bit Enabled HP-UX | 9.4 TS1M2 | |
64-bit Enabled Solaris | 9.4 TS1M2 | |
HP-UX IPF | 9.4 TS1M2 | |
Linux for x64 | 9.4 TS1M2 | |
Solaris for x64 | 9.4 TS1M2 | |