<?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 Re: PROC SGMAP bubble plot with gradient fill without Viya (SAS Version 9.04.01M6P110718) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769685#M22083</link>
    <description>&lt;P&gt;Which specific version of SAS are you running?&lt;/P&gt;
&lt;P&gt;If you aren't sure run this code:&lt;/P&gt;
&lt;P&gt;%put &amp;amp;sysvlong;&lt;/P&gt;
&lt;P&gt;then look in the LOG and post the result. It would look something like&lt;/P&gt;
&lt;P&gt;9.04.01M4P110916&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is &lt;STRONG&gt;always&lt;/STRONG&gt; a good idea when asking about any error to copy the code and all the error messages from the log and paste into a text box opened on the forum with the &amp;lt;/&amp;gt; icon that appears above the message window.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 19:26:33 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-09-22T19:26:33Z</dc:date>
    <item>
      <title>PROC SGMAP bubble plot with gradient fill without Viya (SAS Version 9.04.01M6P110718)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769594#M22082</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently trying to create a bubble plot that is gradient-filled by a specific numeric measure. Below is the code I am trying to run as well as code for a map without gradient colors for the purpose of looking at the sample data:&lt;/P&gt;&lt;PRE&gt;/*
Sample Data:
	rx_x = longitude
	rx_y = latitude
	Rx_State = state in which a pharmacy is located
	num_claims = total number of claims at a pharmacy
	sample_num = what I want to create the gradient by
	Rx_ID = ID that corresponds to a pharmacy
	Rx_Type = type of pharmacy

NOTE: the sample data consists of 4 pseudo pharmacies and do not correspond to any real data
*/
DATA sample;
	input rx_x rx_y Rx_State $ num_claims sample_num Rx_ID Rx_Type $;
CARDS;
-73.791809 40.922794 NY 600 0.87 115616 A
-73.836815 40.916695 NY 249 0.98 256156 A
-78.710464 43.170048 NY 105 0.70 615444 B
-95.300003 32.349998 TX 516 0.66 256455 B
;
RUN;


*gradient map attempt;
%let url = http://services.arcgisonline.com/arcgis/rest/services;
PROC SGMAP plotdata=sample (where=(Rx_State="NY"));
  esrimap url="&amp;amp;url/World_Topo_Map";
  title H=2 'Generic Sample Title';
  bubble x=rx_x y=rx_y size=num_claims / bradiusmin=1 bradiusmax=10
	colorresponse=sample_num colormodel=(yellow orange red) name='bub' transparency=0.40;
	gradlegend 'bub';
RUN;

quit;
ods html close;

*working map code;
%let url = http://services.arcgisonline.com/arcgis/rest/services;
PROC SGMAP plotdata=sample (where=(Rx_State="NY"));
  esrimap url="&amp;amp;url/World_Topo_Map";
  title H=2 'Generic Sample Title';
  bubble x=rx_x y=rx_y size=num_claims / bradiusmin=1 bradiusmax=10
	group=Rx_Type transparency=0.4;
RUN;

quit;
ods html close;&lt;/PRE&gt;&lt;P&gt;When I run the color gradient version of the map I get a syntax error because, according to the documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grmapref/p1nywdk7q1c0esn1myhukeensapm.htm#p1bsvvntdmlta5n1p3ilzx72rf6e" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grmapref/p1nywdk7q1c0esn1myhukeensapm.htm#p1bsvvntdmlta5n1p3ilzx72rf6e&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The COLORRESPONSE argument is under version SAS Viya 3.5, Post-9.4M6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was wondering if it was possible to create a bubble map with gradient fill without the use of colorresponse, or without the use of Viya 3.5 or upgrading SAS releases?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:20:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769594#M22082</guid>
      <dc:creator>jrrwactuary</dc:creator>
      <dc:date>2021-09-22T17:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGMAP bubble plot with gradient fill without Viya (SAS Version 9.04.01M6P110718)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769685#M22083</link>
      <description>&lt;P&gt;Which specific version of SAS are you running?&lt;/P&gt;
&lt;P&gt;If you aren't sure run this code:&lt;/P&gt;
&lt;P&gt;%put &amp;amp;sysvlong;&lt;/P&gt;
&lt;P&gt;then look in the LOG and post the result. It would look something like&lt;/P&gt;
&lt;P&gt;9.04.01M4P110916&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is &lt;STRONG&gt;always&lt;/STRONG&gt; a good idea when asking about any error to copy the code and all the error messages from the log and paste into a text box opened on the forum with the &amp;lt;/&amp;gt; icon that appears above the message window.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769685#M22083</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-22T19:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGMAP bubble plot with gradient fill without Viya (SAS Version 9.04.01M6P110718)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769699#M22084</link>
      <description>&lt;P&gt;The SAS version is in the subject line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Log:&lt;/P&gt;&lt;PRE&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         
25         GOPTIONS ACCESSIBLE;
26         %let url = http://services.arcgisonline.com/arcgis/rest/services;
27         PROC SGMAP plotdata=sample (where=(Rx_State="NY"));
28           esrimap url="&amp;amp;url/World_Topo_Map";
SYMBOLGEN:  Macro variable URL resolves to http://services.arcgisonline.com/arcgis/rest/services
29           title H=2 'Generic Sample Title';
30           bubble x=rx_x y=rx_y size=num_claims / bradiusmin=1 bradiusmax=30
31         	colorresponse=num_claims colormodel=(yellow orange red) name='bub' transparency=0.40;
            _____________
            22
            76
ERROR 22-322: Syntax error, expecting one of the following: ;,  BRADIUSMAX, BRADIUSMIN, CM, DATALABEL, DATALABELATTRS, 
              DATALABELPOS, FILL, FILLATTRS, GROUP, IN, LEGENDLABEL, MM, NAME, NOFILL, NOMISSINGGROUP, OUTLINE, PCT, PT, PX, 
              TRANSPARENCY.  
ERROR 76-322: Syntax error, statement will be ignored.
32         	gradlegend 'bub';
33         RUN;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SGMAP used (Total process time):
      real time           0.02 seconds
      user cpu time       0.00 seconds
      system cpu time     0.03 seconds
      memory              544.37k
      OS Memory           32408.00k
      Timestamp           09/22/2021 03:53:15 PM
      Step Count                        3028  Switch Count  1&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/769699#M22084</guid>
      <dc:creator>jrrwactuary</dc:creator>
      <dc:date>2021-09-22T19:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGMAP bubble plot with gradient fill without Viya (SAS Version 9.04.01M6P110718)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/770041#M22085</link>
      <description>&lt;P&gt;I have been in contact with SAS support, and the solution seems to be that, instead of using gradient fill, I should use the GROUP argument in PROC SGMAP to color the bubbles by a custom group:&lt;/P&gt;&lt;PRE&gt;data cities;
  length city $20;
  input y x city $;
  state=37;
  value=rand('integer',1,50);
cards;
35.783411 -78.79892 Cary 
36.0789 -79.826888 Greensboro
35.19755 -80.834514 Charlotte
;
run;
data nc;  
  set mapsgfk.us_counties;
  where state=37;
run;
ods path(prepend) work.tempat(update);
proc template;
  define style mystyle;
    parent=styles.htmlblue;
    style graphdata1 from graphdata1 / color=cxdeebf7;
    style graphdata2 from graphdata2 / color=cx9ecae1;
    style graphdata3 from graphdata3 / color=cx3182bd;
  end;
run;
ods html style=mystyle;
proc sgmap mapdata=nc plotdata=cities;
  choromap  / mapid=id ;
  bubble x=x y=y size=value / group=value;
run;&lt;/PRE&gt;&lt;P&gt;Thank you, Marcia Surratt!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did come across another potential solution that involves using PROC IML In order to utilize R's graphing functionality:&amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_r_toc.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_r_toc.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 20:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGMAP-bubble-plot-with-gradient-fill-without-Viya-SAS/m-p/770041#M22085</guid>
      <dc:creator>jrrwactuary</dc:creator>
      <dc:date>2021-09-23T20:37:50Z</dc:date>
    </item>
  </channel>
</rss>

