<?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: Legend Labels in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86482#M3195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach is to use an annotate data set and the NOLEGEND option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the annotate macros to simplify code. This one places a legend label above a group of circles of different color and size. You probably would want %BAR to indicate just a color region. If you already have an annotate set you can either append this type of data to your existing annotate set.&lt;/P&gt;&lt;P&gt;%annomac;&lt;/P&gt;&lt;P&gt;Data legend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; length function style color $ 30 position $ 1 text $ 30 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain when 'a';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %system (3,3,3); /*uses percent of graph area for coordinates*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* move the title for the legend down instead of moving the rest up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in quick adjustment to remove the NONE*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(42, 79.5, 'Home Visiting Programs' ,BLACK, 0, 0, 2.0, swissB, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 76, 0, 360, .6 ,H10E66AA, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 76.8,&amp;nbsp; ' Parents as Teachers (PAT)' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 73, 0, 360, .6,orange, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 73.6,&amp;nbsp; ' Early Head Start (EHS)' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 70, 0, 360,1.1,MEDIUMVIOLETRED, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 70.6,&amp;nbsp; ' EHS &amp;amp; PAT' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 21:24:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-04-17T21:24:13Z</dc:date>
    <item>
      <title>Legend Labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86481#M3194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to keep the "5-19" range on my legend but I do not have any data that falls in it so it gets removed from my map. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend1 across=1 origin=(65,10)pct mode=share shape=bar(2,2)pct label=(h=14pt position=top "Count")&lt;/P&gt;&lt;P&gt;value=(h=12pt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value comm&lt;/P&gt;&lt;P&gt;1-4&amp;nbsp; = '1 - 4'&lt;/P&gt;&lt;P&gt;5-19 = '5 - 19'&lt;/P&gt;&lt;P&gt;20-49 = '20 - 49'&lt;/P&gt;&lt;P&gt;50-high = '50 - 885';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title "XXXXXXXXXXXXXXXX";&lt;/P&gt;&lt;P&gt;footnote j=r 'XXXXXXXXXXXXXXX';&lt;/P&gt;&lt;P&gt;proc gmap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data=A1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map=NJ all annotate=P;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id COUNTY; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; choro count / discrete legend=legend1 coutline=black anno=anno1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format count comm.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 15:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86481#M3194</guid>
      <dc:creator>AAWTomHanks</dc:creator>
      <dc:date>2012-04-17T15:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86482#M3195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach is to use an annotate data set and the NOLEGEND option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the annotate macros to simplify code. This one places a legend label above a group of circles of different color and size. You probably would want %BAR to indicate just a color region. If you already have an annotate set you can either append this type of data to your existing annotate set.&lt;/P&gt;&lt;P&gt;%annomac;&lt;/P&gt;&lt;P&gt;Data legend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; length function style color $ 30 position $ 1 text $ 30 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain when 'a';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %system (3,3,3); /*uses percent of graph area for coordinates*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* move the title for the legend down instead of moving the rest up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in quick adjustment to remove the NONE*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(42, 79.5, 'Home Visiting Programs' ,BLACK, 0, 0, 2.0, swissB, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 76, 0, 360, .6 ,H10E66AA, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 76.8,&amp;nbsp; ' Parents as Teachers (PAT)' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 73, 0, 360, .6,orange, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 73.6,&amp;nbsp; ' Early Head Start (EHS)' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %slice(50, 70, 0, 360,1.1,MEDIUMVIOLETRED, SOLID, NONE );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %LABEL(51, 70.6,&amp;nbsp; ' EHS &amp;amp; PAT' ,BLACK, 0, 0, 2.0, swissl, 6);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 21:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86482#M3195</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-04-17T21:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86483#M3196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... here's something that I have used for similar problems (it's looks LONG, but I had to create a NJ response data set ... that's data that you already have so all you have to do for the response data set is step #2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1&amp;nbsp; add an observation to the map data set with a non-NJ county number (I used 999)&lt;/P&gt;&lt;P&gt;#2&amp;nbsp; add an observation to the response data&amp;nbsp; with the same county number and a value to be mapped that falls in the missing range (5-19)&lt;/P&gt;&lt;P&gt;#3&amp;nbsp; you get a map with only 3 colors, but a legend with 4 entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* New Jersey map data set;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc gproject data=maps.counties out=nj;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;id county;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;where state eq 34 and density lt 6;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* response data set with one observation per county;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;create table njfake as select distinct county from nj;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* add one observation to the map data set ... a point with county = 999;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data nj;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set nj end=last;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if last then do;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; county = 999;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* add some data to the response data set ... no observations in the range 5 to 19;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data njfake;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;array x(3) _temporary_ (3 25 75);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set njfake;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;dummy = x(rantbl(999,.33,.33));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* add one observation to the response data set ... county = 999, dummy in the range 5-19;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data njfake;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set njfake end=last;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if last then do;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; county = 999;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; dummy = 5;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;value comm &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1-4&amp;nbsp; = '1 - 4' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;5-19 = '5 - 19' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;20-49 = '20 - 49' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;50-high = '50 - 885';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;goptions reset=all ftext='calibri' htext=2 gunit=pct;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;legend1 mode=share origin=(5,45)pct shape=bar(3,4)pct across=1 label=(position=top '!!! HOORAY !!!');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;title h=4 'THREE COLORS IN MAP, FOUR COLORS IN LEGEND' ls=2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* draw the map ... legend has four entries, map has three colors (you cannot see county 999);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc gmap data=njfake map=nj all;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;id county;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;choro dummy / discrete legend=legend1 coutline=black;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;format dummy comm.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11518i8953FE6B8369FDDE/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="greetings_from_asbury_park.png" title="greetings_from_asbury_park.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 22:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86483#M3196</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-04-17T22:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86484#M3197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the cool things about gmap is that it has a 'midpoints=' option, and you can specify the midpoints you want to appear in the legend (even if those values aren't in ever set of data you might plot on the map).&amp;nbsp; This way, as you are desiring, all the colors get shown in the legend, and therefore all the maps you create will consistently map the same colors to the same values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you're using a user-defined format (UDF) to map ranges of values to legend colors.&amp;nbsp; I had never tried using this with midpoints= before, but it appears to work ... Just specify a 'midpoint' that happens to be somewhere in each of the UDF ranges, and they will all show up in the legend. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've written a little example, with (random) data, to demonstrate (try it with &amp;amp; without the midpoints= to see the difference):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data NJ; set maps.uscounty (where=(state=stfips('NJ'));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table A1 as select unique county from NJ;&lt;BR /&gt;quit; run;&lt;BR /&gt;data A1; set A1;&lt;BR /&gt;count=round(ranuni(556)*49);&lt;BR /&gt;if count&amp;gt;=5 and count&amp;lt;=19 then count=800;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;legend1 across=1 origin=(65,10)pct mode=share shape=bar(2,2)pct&lt;BR /&gt; label=(h=14pt position=top "Count") value=(h=12pt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value comm&lt;BR /&gt;1-4&amp;nbsp; = '1 - 4'&lt;BR /&gt;5-19 = '5 - 19'&lt;BR /&gt;20-49 = '20 - 49'&lt;BR /&gt;50-high = '50 - 885';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data=A1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map=NJ all;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id COUNTY;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; choro count / discrete&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; midpoints = 1 5 20 50&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend=legend1 coutline=black;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format count comm.;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 12:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Legend-Labels/m-p/86484#M3197</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-04-18T12:57:51Z</dc:date>
    </item>
  </channel>
</rss>

