Sample 54315: Customize your symbols with the SYMBOLCHAR statement in PROC SGPLOT
You can customize the symbols on graphs that you generate with the SGPLOT procedure by using the SYMBOLCHAR and SYMBOLIMAGE statements. These statements are available beginning in the first maintenance release of SAS® 9.4 (TS1M1).
The sample code on the Full Code tab illustrates how to specify a custom symbol using the SYMBOLCHAR statement. Custom symbols are defined as Unicode values. A list of valid Unicode values can be found here.
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 program illustrates the syntax for the SYMBOLCHAR statement. The code requires the first maintenance release of SAS 9.4 (TS1M1) or higher.
data temperatures;
input Day : $9. High Low Forecast $7.;
datalines;
Monday 73 61 Cloudy
Tuesday 76 60 Showers
Wednesday 79 59 Sunny
Thursday 80 60 Sunny
Friday 79 64 Showers
Saturday 73 63 Cloudy
Sunday 75 64 Showers
;
run;
data myattrmap;
input id $ value $ markercolor $ markersymbol $;
datalines;
myid Cloudy grey cloud
myid Sunny orange sun
myid Showers blue umbrella
;
run;
proc sgplot data=temperatures dattrmap=myattrmap;
title 'Temperatures in Cary, NC';
title2 'The Week of September 1';
highlow x=day low=low high=high / lineattrs=(color=biyg thickness=20pt);
scatter x=day y=high / markerattrs=(size=25pt) attrid=myid group=forecast;
symbolchar name=Cloud char='2601'x / voffset=.25;
symbolchar name=Sun char='2600'x / voffset=.25;
symbolchar name=Umbrella char='2602'x / voffset=.25;
xaxis label='Day of the Week';
xaxistable high / valueattrs=(size=9pt weight=bold)location=inside;
xaxistable low / valueattrs=(size=9pt weight=bold) location=inside;
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 ==> SGPLOT
|
Date Modified: | 2023-06-05 06:14:34 |
Date Created: | 2014-10-10 14:56:35 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 TS1M1 | |
Z64 | 9.4 TS1M1 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M1 | |
Microsoft® Windows® for x64 | 9.4 TS1M1 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M1 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M1 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M1 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M1 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M1 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M1 | |
Microsoft Windows 8.1 Pro | 9.4 TS1M1 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M1 | |
Microsoft Windows Server 2008 | 9.4 TS1M1 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M1 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M1 | |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M1 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M1 | |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M1 | |
Microsoft Windows Server 2012 Std | 9.4 TS1M1 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M1 | |
Windows 7 Enterprise x64 | 9.4 TS1M1 | |
Windows 7 Home Premium 32 bit | 9.4 TS1M1 | |
Windows 7 Home Premium x64 | 9.4 TS1M1 | |
Windows 7 Professional 32 bit | 9.4 TS1M1 | |
Windows 7 Professional x64 | 9.4 TS1M1 | |
Windows 7 Ultimate 32 bit | 9.4 TS1M1 | |
Windows 7 Ultimate x64 | 9.4 TS1M1 | |
64-bit Enabled AIX | 9.4 TS1M1 | |
64-bit Enabled HP-UX | 9.4 TS1M1 | |
64-bit Enabled Solaris | 9.4 TS1M1 | |
HP-UX IPF | 9.4 TS1M1 | |
Linux for x64 | 9.4 TS1M1 | |
Solaris for x64 | 9.4 TS1M1 | |