Sample 69818: Using the INSET statement to add text to panels
This SAS Note shows how to use the INSET statement in PROC SGPANEL to add text to each panel.
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 code shows how to use the INSET statement in PROC SGPANEL to add text to each panel.
/* Create sample data */
data vs;
length vstest2 $9;
input VSSTRESN VSDY vstest2 $ id;
datalines;
68 -16 Diastolic 2
68 -2 Diastolic 2
68 1 Diastolic 2
70 15 Diastolic 2
68 16 Diastolic 2
70 27 Diastolic 2
70 29 Diastolic 2
74 41 Diastolic 2
60 57 Diastolic 2
62 83 Diastolic 2
64 114 Diastolic 2
54 -16 Pulse 3
57 -2 Pulse 3
54 1 Pulse 3
57 15 Pulse 3
54 16 Pulse 3
57 27 Pulse 3
60 29 Pulse 3
60 41 Pulse 3
51 57 Pulse 3
72 83 Pulse 3
51 114 Pulse 3
132 -16 Systolic 1
146 -2 Systolic 1
130 1 Systolic 1
122 15 Systolic 1
132 16 Systolic 1
130 27 Systolic 1
120 29 Systolic 1
120 41 Systolic 1
140 57 Systolic 1
122 83 Systolic 1
130 114 Systolic 1
;
run;
/*--Sort by ID--*/
proc sort data=vs out=vss;
by id;
run;
/*--Vital Signs Panel with Inset--*/
ods graphics / reset attrpriority=color width=6in height=4in imagename="Panels_Insets";
title "Vital Statistics for Patient Id = xx-xxx-xxxx";
proc sgpanel data=vss noautolegend nocycleattrs;
panelby vstest2 / onepanel layout=rowlattice uniscale=column novarname spacing=10 noheader sort=data;
refline 0 / axis=x lineattrs=(thickness=1 color=black);
series x=vsdy y=vsstresn / group=vstest2 lineattrs=(thickness=3) nomissinggroup name='bp';
scatter x=vsdy y=vsstresn / group=vstest2 markerattrs=(symbol=circlefilled size=11);
scatter x=vsdy y=vsstresn / group=vstest2 markerattrs=(symbol=circlefilled size=5 color=white);
inset vstest2 / nolabel position=topright textattrs=(size=9);
keylegend 'bp' / title='Vitals:' across=3 linelength=20;
rowaxis grid display=(nolabel) valueattrs=(size=7) labelattrs=(size=8);
colaxis grid label='Study Days' valueattrs=(size=7) labelattrs=(size=8);
run;
title;
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 ==> SGPANEL
|
Date Modified: | 2023-01-31 13:23:31 |
Date Created: | 2023-01-19 09:28:29 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 | | 9.4 TS1M0 | |
z/OS 64-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft® Windows® for x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Pro x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 10 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 R2 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Std | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Std | 9.4 | | 9.4 TS1M0 | |
Windows 7 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Windows 7 Professional x64 | 9.4 | | 9.4 TS1M0 | |
64-bit Enabled AIX | 9.4 | | 9.4 TS1M0 | |
64-bit Enabled Solaris | 9.4 | | 9.4 TS1M0 | |
HP-UX IPF | 9.4 | | 9.4 TS1M0 | |
Linux for x64 | 9.4 | | 9.4 TS1M0 | |
Solaris for x64 | 9.4 | | 9.4 TS1M0 | |