Sample 65199: Using the GROUP= option to set colors for the marker symbols for a specific variable on a map
In SAS® 9.4M6 (TS1M6), the GROUP= option in the SCATTER statement can help to set colors for marker symbols for a specific variable.
To access the sample program, click the Full Code tab. The program uses the MAPSGFK.US_COUNTIES data set from the SAS/GRAPH® software map data sets.
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 GROUP= option in the SCATTER statement can help to set colors for marker symbols for a specific variable. This program uses the MAPSGFK.US_COUNTIES data set.
/* Create a county map data set for Tennessee */
/* The SAS/GRAPH map data sets must be installed
to use the MAPSGFK.US_COUNTIES data set */
data TN(rename=(long=x lat=y));
set mapsgfk.us_counties(drop=x y );
where id1="US-47";
run;
/* Create a data set containing the ZIP codes in
Tennessee from the SASHELP.ZIPCODE data set */
data TNZips;
set sashelp.zipcode(keep=zip x y state county timezone);
where state=47;
run;
title 'ZIP Code time zones in Tennessee';
proc sgmap mapdata=TN plotdata=TNZips;
openstreetmap;
/* The LINEATTRS= option is available beginning with SAS 9.4M6 */
choromap / mapid=id lineattrs=(color=graycc);
/* The GROUP= option is available beginning with SAS 9.4M6 */
scatter x=x y=y / markerattrs=(symbol=circlefilled) group=timezone
name='markers';
keylegend 'markers' / title='ZIP Code Time Zone';
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 shows you how to use the GROUP= option in the SCATTER statement to set colors for the marker symbols for a specific variable. This sample requires the SAS/GRAPH® software map data sets to be installed.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGMAP
|
Date Modified: | 2019-12-09 09:23:08 |
Date Created: | 2019-12-04 15:15:07 |
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for x64 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows 8 Enterprise x64 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows 8 Pro x64 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows 8.1 Pro x64 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows 10 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2012 Datacenter | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2012 R2 Std | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2012 Std | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2016 | 9.4_M6 | | 9.4 TS1M6 | |
Microsoft Windows Server 2019 | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Enterprise 32 bit | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Enterprise x64 | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Home Premium 32 bit | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Home Premium x64 | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Professional 32 bit | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Professional x64 | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Ultimate 32 bit | 9.4_M6 | | 9.4 TS1M6 | |
Windows 7 Ultimate x64 | 9.4_M6 | | 9.4 TS1M6 | |
64-bit Enabled AIX | 9.4_M6 | | 9.4 TS1M6 | |
64-bit Enabled Solaris | 9.4_M6 | | 9.4 TS1M6 | |
HP-UX IPF | 9.4_M6 | | 9.4 TS1M6 | |
Linux for x64 | 9.4_M6 | | 9.4 TS1M6 | |
Solaris for x64 | 9.4_M6 | | 9.4 TS1M6 | |