<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to change colors in scatter map using PROC SGMAP (SAS 9.4) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642138#M19784</link>
    <description>&lt;P&gt;I am using PROC SGMAP to spatially plot locations of air-bnbs in San Francisco. I am trying to color code the points based on reviews (i.e. red=poor, yellow=standard, and green=excellent). Using this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am able to produce a plot with the default colors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kleinl1_0-1587602434232.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38568i771AA76859A99AC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kleinl1_0-1587602434232.png" alt="kleinl1_0-1587602434232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried using style modification:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
 define style MyStyle;
 parent = Styles.Listing;
/* Attempt to change to different colors */
 class GraphData1 / contrastcolor = GraphColors('gcdata4');
 class GraphData2 / contrastcolor = GraphColors('gcdata5');
 class GraphData3 / contrastcolor = GraphColors('gcdata6');
 end;
run;
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and %Modstyle:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%modstyle
 (name=MyStyle 
 ,parent=Listing 
 ,type=CLM 
 ,colors=cx543005 cx9D3CDB cx7F8E1F 
 );
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the default colors do not change. Using&amp;nbsp;STYLEATTRS yields an error that the "Statement is not valid or it is used out of proper order":&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap plotdata=checkout.airbnb_SF_Train;
STYLEATTRS DATACOLORS=(green, yellow, red);
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I also tried using an attribute map, but proc sgmap did not like the inclusion of dattrmap=&amp;lt;my attribute map&amp;gt;. I'm at a loss of what else to try to change the color defaults.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 00:54:34 GMT</pubDate>
    <dc:creator>kleinl1</dc:creator>
    <dc:date>2020-04-23T00:54:34Z</dc:date>
    <item>
      <title>How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642138#M19784</link>
      <description>&lt;P&gt;I am using PROC SGMAP to spatially plot locations of air-bnbs in San Francisco. I am trying to color code the points based on reviews (i.e. red=poor, yellow=standard, and green=excellent). Using this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am able to produce a plot with the default colors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kleinl1_0-1587602434232.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38568i771AA76859A99AC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kleinl1_0-1587602434232.png" alt="kleinl1_0-1587602434232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried using style modification:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
 define style MyStyle;
 parent = Styles.Listing;
/* Attempt to change to different colors */
 class GraphData1 / contrastcolor = GraphColors('gcdata4');
 class GraphData2 / contrastcolor = GraphColors('gcdata5');
 class GraphData3 / contrastcolor = GraphColors('gcdata6');
 end;
run;
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and %Modstyle:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%modstyle
 (name=MyStyle 
 ,parent=Listing 
 ,type=CLM 
 ,colors=cx543005 cx9D3CDB cx7F8E1F 
 );
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the default colors do not change. Using&amp;nbsp;STYLEATTRS yields an error that the "Statement is not valid or it is used out of proper order":&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap plotdata=checkout.airbnb_SF_Train;
STYLEATTRS DATACOLORS=(green, yellow, red);
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I also tried using an attribute map, but proc sgmap did not like the inclusion of dattrmap=&amp;lt;my attribute map&amp;gt;. I'm at a loss of what else to try to change the color defaults.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 00:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642138#M19784</guid>
      <dc:creator>kleinl1</dc:creator>
      <dc:date>2020-04-23T00:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642228#M19785</link>
      <description>&lt;P&gt;What version of SAS 9.4 are you using -- 9.4m5 or 9.4m6?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use:&lt;/P&gt;
&lt;P&gt;%put &amp;amp;sysvlong;&lt;/P&gt;
&lt;P&gt;to show the version. Just post the output from the log here. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 13:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642228#M19785</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-04-23T13:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642274#M19786</link>
      <description>It's 9.4m6 (9.04.01M6P111518). Thanks!</description>
      <pubDate>Thu, 23 Apr 2020 15:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642274#M19786</guid>
      <dc:creator>kleinl1</dc:creator>
      <dc:date>2020-04-23T15:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642299#M19787</link>
      <description>&lt;P&gt;I am not as familiar with SGMAP features.&amp;nbsp; However, one workaround to try is to restructure your Airbnb data in "Wide" format, like Excel.&amp;nbsp; One column per type (Poor, Standard, Excellent).&amp;nbsp; Use missing values where needed.&amp;nbsp; Then, you can use three separate scatter statements, one per column, and set the colors explicitly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 15:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642299#M19787</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2020-04-23T15:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642317#M19788</link>
      <description>&lt;P&gt;For now, you will have to use the custom style approach. Your style definition works for me. Do you happen to also have ODS HTML open, and you are looking at the HTML output instead of the LISTING output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, both the STYLEATTRS statement and attribute map support will be in the next release for SGMAP.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 15:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642317#M19788</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-04-23T15:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colors in scatter map using PROC SGMAP (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642407#M19789</link>
      <description>&lt;P&gt;I wasn't looking at the HTML output -- thank you for pointing that out!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 21:30:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-colors-in-scatter-map-using-PROC-SGMAP-SAS-9-4/m-p/642407#M19789</guid>
      <dc:creator>kleinl1</dc:creator>
      <dc:date>2020-04-23T21:30:27Z</dc:date>
    </item>
  </channel>
</rss>

