<?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: 2 Legends in GMAP in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/659039#M20066</link>
    <description>&lt;P&gt;Here's one way to do it in a subtitle/title2 ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 c=gray33 f='albany amt' h=16pt "Map with custom legend in subtitle";&lt;BR /&gt;title2 &lt;BR /&gt;c=red h=12pt f='albany amt/unicode' '25cf'x &lt;BR /&gt;c=gray33 f='albany amt' h=10pt "=Red Ball "&lt;BR /&gt;c=blue h=12pt f='albany amt/unicode' '25cf'x &lt;BR /&gt;c=gray33 f='albany amt' h=10pt "=Blue Ball";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gmap data=sashelp.us_data map=mapsgfk.us;&lt;BR /&gt;id statecode;&lt;BR /&gt;choro density_1910 / levels=5;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gmap_legend.png" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/43234iADF38C79F71176A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="gmap_legend.png" alt="gmap_legend.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2020 16:26:33 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2020-06-15T16:26:33Z</dc:date>
    <item>
      <title>2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658089#M20046</link>
      <description>&lt;P&gt;I am using the GMAP procedure to map counties in a state, with the counties color coded.&amp;nbsp; I am using a legend for that and it displays the way I want, no problem.&amp;nbsp; &amp;nbsp;I also am using a separate dataset for the annotate feature.&amp;nbsp; This dataset includes points which are color coded with different colors and definitions than the variable I am using in the choro statement.&amp;nbsp; &amp;nbsp;How can I insert a second legend to display the meanings of the colors of the points displayed on the map? I'm aware of using subtitles, but I'd rather have a legend with the actual symbol and color showing the definition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anno_all; set points;
drop state;
length function $8 style $35 text $35;
xsys='2'; ysys='2'; hsys='3'; when='a';
function='symbol'; text='V';position='5';
size=2; ;
style='marker' ; 
if decert_ind = 'N' then color = 'BIGB';
else color='red' ;
run;


goptions reset=all;
pattern1 value=msolid color=BILG;
pattern2 value=msolid color=PAOY;
pattern3 value=msolid color=BIOY;
pattern4 value=msolid color=VIO;
pattern5 value=msolid color=VIYPK;


proc gmap data=state_map1 map=state_map1 anno=anno_all;
id state county;
choro risk_score /  coutline=cx739436 
 ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658089#M20046</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-12T14:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658092#M20047</link>
      <description>&lt;P&gt;I would like to clarify about subtitles: if the subtitle can contain the symbol and color used in the map, then that would work.&amp;nbsp; It doesn't have to be a separate floating legend.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658092#M20047</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-12T14:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658097#M20048</link>
      <description>&lt;P&gt;You add the text to the annotate data sets with appropriate coordinates to display near the symbol.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should investigate the macros made available by %annomac.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add this line of code to your program before the data step where you create the annotate data set:&lt;/P&gt;
&lt;PRE&gt;%annomac ;&lt;/PRE&gt;
&lt;P&gt;execute it one (highlight and run).&lt;/P&gt;
&lt;P&gt;The log will show you something like:&lt;/P&gt;
&lt;PRE&gt;*** ANNOTATE macros are now available ***

 For further information on ANNOTATE macros, enter,
    %HELPANO(macroname), (for specific macros)
    %HELPANO(ALL), (for information on all macros)
 or %HELPANO (for a list of macro names)

&lt;/PRE&gt;
&lt;P&gt;Run the %helpano(all) to get a list of the macros and parameters (the individual macros are in the online documentation as well). This will help you create records of values appropriate to an annotate data set.&lt;/P&gt;
&lt;P&gt;Likely you would use a %LABEL to use similar coordinates to the points you are currently using for the symbols, just change the Position parameter shift the location by a bit to avoid overwriting, or if your symbols are large enough that position won't move things enough then change the X coordinate a bit to move further.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658097#M20048</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-12T15:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658104#M20049</link>
      <description>I would rather have the definitions of the colors (only 2 of them) of the points located either as a subtitle or legend on the side of the map.  There are many points on the map, but only two possible categories each fit in.  I've tried creating a macro with unicode and then calling the macros in a subtitle (like here:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2014/06/10/sas-stars-on-thars/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2014/06/10/sas-stars-on-thars/&lt;/A&gt; ), but the symbols of the unicode are not displaying.</description>
      <pubDate>Fri, 12 Jun 2020 15:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658104#M20049</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-12T15:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658112#M20050</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/264750"&gt;@RandoDando&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I would rather have the definitions of the colors (only 2 of them) of the points located either as a subtitle or legend on the side of the map. There are many points on the map, but only two possible categories each fit in. I've tried creating a macro with unicode and then calling the macros in a subtitle (like here:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2014/06/10/sas-stars-on-thars/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sasdummy/2014/06/10/sas-stars-on-thars/&lt;/A&gt; ), but the symbols of the unicode are not displaying.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Annotate data sets can display values out side of the actual map area if that is your concern the Xsys and Ysys parameters indicate which address system to use.&lt;/P&gt;
&lt;P&gt;Or Legends can be created outside of the graph area, did you actually try one? You can create pretty complex legends though you would have to include the values for your "automatic" legend currently created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The link only references RTF text output, not graphic output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658112#M20050</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-12T15:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658129#M20056</link>
      <description>&lt;P&gt;You might want to consider using PROC SGMAP instead. That way, you can overlay a SCATTER plot instead of an annotation and be able to display multiple legends. The code would look something like the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap mapresp=state_map1 mapdata=state_map1 plotdata=pointsl;
choromap risk_score /  lineattrs=(color=cx739436);
scatter x=x y=y / group=decert_ind;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can even put a background map behind your chroma (or in place of it). Let me know if you have any questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 17:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658129#M20056</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-06-12T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658135#M20057</link>
      <description>Unfortunately, I do not have SGMAP.  Strangely, I recall running SGPLOT with success...</description>
      <pubDate>Fri, 12 Jun 2020 17:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658135#M20057</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-12T17:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658218#M20060</link>
      <description>&lt;P&gt;What version of SAS do you have?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 21:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/658218#M20060</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-06-12T21:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/659039#M20066</link>
      <description>&lt;P&gt;Here's one way to do it in a subtitle/title2 ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 c=gray33 f='albany amt' h=16pt "Map with custom legend in subtitle";&lt;BR /&gt;title2 &lt;BR /&gt;c=red h=12pt f='albany amt/unicode' '25cf'x &lt;BR /&gt;c=gray33 f='albany amt' h=10pt "=Red Ball "&lt;BR /&gt;c=blue h=12pt f='albany amt/unicode' '25cf'x &lt;BR /&gt;c=gray33 f='albany amt' h=10pt "=Blue Ball";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gmap data=sashelp.us_data map=mapsgfk.us;&lt;BR /&gt;id statecode;&lt;BR /&gt;choro density_1910 / levels=5;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gmap_legend.png" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/43234iADF38C79F71176A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="gmap_legend.png" alt="gmap_legend.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 16:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/659039#M20066</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-06-15T16:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660036#M20082</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;Your example looks like exactly what I want, but even after copying your title code and just changing the text in side the double quotes after the equal sign, the symbols I get in my output are percent signs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas output.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/43930i2976473E99607F90/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas output.png" alt="sas output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 13:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660036#M20082</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-16T13:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660105#M20083</link>
      <description>&lt;P&gt;Are you using png output?&lt;/P&gt;
&lt;P&gt;Are you using gtitles? (titles as part of the graph/png image, rather than titles outside the graph?)&lt;/P&gt;
&lt;P&gt;Are you perhaps submitting your code through EG? (which I think might default to not-gtitles)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660105#M20083</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-06-16T16:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660107#M20084</link>
      <description>I am using EG, and not using any ods statements at the moment.</description>
      <pubDate>Tue, 16 Jun 2020 16:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660107#M20084</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-16T16:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Legends in GMAP</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660112#M20085</link>
      <description>&lt;P&gt;Thank you for your latest reply. The issue was with the environment. I simply output to a PDF, specified a style of output to change the EG default, then changed the unicode to a shaded star to match the symbols used in my annotate set as such:&amp;nbsp; ('2605'x).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options orientation=landscape papersize=legal;
ods pdf style=sasweb
file="\\....\Map.pdf";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The PDF file in the output file looks nice.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 17:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-Legends-in-GMAP/m-p/660112#M20085</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-06-16T17:01:33Z</dc:date>
    </item>
  </channel>
</rss>

