<?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: Same legend in all gmaps in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/832635#M329121</link>
    <description>&lt;P&gt;I'm not sure how you'd implement the 2 suggestions provided so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But here's what I recommend. Use gmap's "midpoints=" option to list all the things you want in the legend (then they'll appear, even if they aren't in the data in that particular map). Here's a short example showing how to use it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data foo1;
statecode='NC'; value='ABC'; output;
statecode='SC'; value='PQR'; output;
run;

data foo2;
statecode='NC'; value='ABC'; output;
statecode='SC'; value='ABC'; output;
run;

proc gmap data=foo1 map=maps.us;
id statecode;
choro value / midpoints='ABC' 'PQR';

proc gmap data=foo2 map=maps.us;
id statecode;
choro value / midpoints='ABC' 'PQR';

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map1.png" style="width: 581px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75110i995C9741555C8AF4/image-dimensions/581x435?v=v2" width="581" height="435" role="button" title="map1.png" alt="map1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map2.png" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75111iB7DBF8D45A79D39F/image-dimensions/585x439?v=v2" width="585" height="439" role="button" title="map2.png" alt="map2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Sep 2022 13:24:11 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2022-09-10T13:24:11Z</dc:date>
    <item>
      <title>Same legend in all gmaps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681168#M206009</link>
      <description>&lt;P&gt;I am allocating zipcodes to facilities using a proc optmodel. After it is done, I am comparing initial and final maps. How can I make the legends the same color if the proc optmodel is removing some facilities ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My response data looks like [zip,facility] , eg [12345, ABC].[456789,PQR] and model might tell me [12345,ABC],[456789,ABC] thus shutting down PQR facility.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 22:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681168#M206009</guid>
      <dc:creator>nithishsaji94</dc:creator>
      <dc:date>2020-09-02T22:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Same legend in all gmaps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681213#M206031</link>
      <description>&lt;P&gt;The only way is to manually&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;list the facilities and assign them a colour (one pattern for each), and then use the second list of facilities to assign the remaining ones the same pattern.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;For example&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;ABC =&amp;gt; pattern1=blue&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;ABD =&amp;gt; pattern2=red&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;ABE =&amp;gt; pattern3=green&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;ABC =&amp;gt; pattern1=blue&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;ABE =&amp;gt; pattern2=green&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 03:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681213#M206031</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-03T03:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Same legend in all gmaps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681390#M206092</link>
      <description>&lt;P&gt;Easiest is likely to define a single legend with all of the facilities and use that. Yes, some facilities that are not included will be in the legend. I suggest that having legend items that do not appear in the map may be a way to quickly identify which were removed by the modeling or other processes.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 15:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/681390#M206092</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-03T15:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Same legend in all gmaps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/832635#M329121</link>
      <description>&lt;P&gt;I'm not sure how you'd implement the 2 suggestions provided so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But here's what I recommend. Use gmap's "midpoints=" option to list all the things you want in the legend (then they'll appear, even if they aren't in the data in that particular map). Here's a short example showing how to use it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data foo1;
statecode='NC'; value='ABC'; output;
statecode='SC'; value='PQR'; output;
run;

data foo2;
statecode='NC'; value='ABC'; output;
statecode='SC'; value='ABC'; output;
run;

proc gmap data=foo1 map=maps.us;
id statecode;
choro value / midpoints='ABC' 'PQR';

proc gmap data=foo2 map=maps.us;
id statecode;
choro value / midpoints='ABC' 'PQR';

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map1.png" style="width: 581px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75110i995C9741555C8AF4/image-dimensions/581x435?v=v2" width="581" height="435" role="button" title="map1.png" alt="map1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map2.png" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75111iB7DBF8D45A79D39F/image-dimensions/585x439?v=v2" width="585" height="439" role="button" title="map2.png" alt="map2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 13:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-legend-in-all-gmaps/m-p/832635#M329121</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2022-09-10T13:24:11Z</dc:date>
    </item>
  </channel>
</rss>

