<?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: using arrows to label provinces on map (gmap) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/467312#M16072</link>
    <description>&lt;P&gt;Hello Robert,&lt;/P&gt;&lt;P&gt;thanks for your reply.&amp;nbsp; Its about the same datasets you helped me to solve on this link:&lt;/P&gt;&lt;P&gt;&lt;A title="using colors/formats gmap" href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yes I have the latitudes and longitudes in the test.sas7bdat&lt;/P&gt;&lt;P&gt;I tried to follow your example but I could unfortunately solve the problem. I will be glad if you can help me here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the datasets again but they are the same as that on this link:&lt;/P&gt;&lt;P&gt;&lt;A title="using-colors-on-maps(gmap)" href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jun 2018 08:36:21 GMT</pubDate>
    <dc:creator>Anita_n</dc:creator>
    <dc:date>2018-06-04T08:36:21Z</dc:date>
    <item>
      <title>using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/458575#M15793</link>
      <description>&lt;P&gt;How can I tell sas to move labels which have little spaces on map, outside the map and instead use arrows to point to the province?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 10:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/458575#M15793</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-04-30T10:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/458699#M15808</link>
      <description>&lt;P&gt;This sounds like an annotate data set is required.&lt;/P&gt;
&lt;P&gt;Your requirement will be to determine the x,y coordinates of where everything needs to appear on the map.&lt;/P&gt;
&lt;P&gt;Then build a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS supplied&amp;nbsp;macro %annomac should be available if you have GMAP installed. Add this code:&lt;/P&gt;
&lt;P&gt;%annomac;&lt;/P&gt;
&lt;P&gt;to make all of the other annotate macros available. The log will show how to get descriptions of what the various macros will help you do such as&lt;/P&gt;
&lt;P&gt;%helpano( help);&lt;/P&gt;
&lt;P&gt;My first step would be to use the %Maplabel macro to create a data set with the text of the labels and an approximately centered location.&lt;/P&gt;
&lt;P&gt;If the text only needs to me moved a bit you can adjust the x and or y coordinates manually in a data step with code like&lt;/P&gt;
&lt;P&gt;Data want_anno;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set maplabelset;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; select (mapidvariable);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when(someidvalue) do; x=0.5; y=0.06; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when(otheridvalue) x=0.04; /* example of only one coordinate needing adjustment*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;otherwise;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you actually cannot get a location that will display the text then you need to specify:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 1) a location for the actual text label&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 2) the text to display at that location&amp;nbsp;&amp;nbsp; (these two can be done with a %label macro call.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 3) specify a start location (near the text label) coordinates,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;4)&amp;nbsp;end location for an arrow (the %maplabel location likely&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 5) specify the arrow appearance options&amp;nbsp; (the %arrow macro should work for 3,4,5)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The individual annotate macros such as %arrow should appear in the online documentation as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Insert the appropriate macro calls for the id variable in the SELECT block for the ids that need the moved label and the arrow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then tell gmap to use the annotate data set. Please be aware the you can use two annotate data sets, one on the Proc Statement and one on a plot statement like CHORO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are likely to have many of these maps it will likely be a good idea to create a permanent data set with the appropriate coordinates to reuse.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/458699#M15808</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-30T18:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459195#M15827</link>
      <description>&lt;P&gt;Hi ballardw, thanks for your reply and explanation. I will try that and leave a feedback. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 06:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459195#M15827</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-05-02T06:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459254#M15831</link>
      <description>&lt;P&gt;Hi bellardw,&lt;/P&gt;&lt;P&gt;I wasn't successful with the code. Maybe you could use this datasets on this link to explain it better. Here is the link &lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 11:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459254#M15831</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-05-02T11:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459275#M15832</link>
      <description>&lt;P&gt;One of my recent blog posts had a map with custom label placement, and arrows pointing from the label to the geographic area. I used lat/long coordinates for both the geographic label, and the area on the map:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2018/04/23/can-you-guess-which-10-rivers-produce-95-of-oceans-plastic-pollution/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2018/04/23/can-you-guess-which-10-rivers-produce-95-of-oceans-plastic-pollution/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a link to the code I used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd97/rivers_and_plastic_info.htm" target="_blank"&gt;http://robslink.com/SAS/democd97/rivers_and_plastic_info.htm&lt;/A&gt;&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="rivers_and_plastic_map.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20308i47DC2ED871708778/image-size/large?v=v2&amp;amp;px=999" role="button" title="rivers_and_plastic_map.png" alt="rivers_and_plastic_map.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 12:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459275#M15832</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-05-02T12:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459478#M15842</link>
      <description>&lt;P&gt;Hi Robert, thanks I will try that to see if I will be successful&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 19:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/459478#M15842</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-05-02T19:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/460411#M15883</link>
      <description>&lt;P&gt;Hey Robert,&lt;/P&gt;&lt;P&gt;I have being struggling with your code samples but am not getting through.&lt;/P&gt;&lt;P&gt;This is my code,&amp;nbsp; maybe am doing something wrong but I can't fish it out. Please I need your help again. The labels are for the map on the link &lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is the code I have written so far&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anno_drawarrow;
length function $8 color $8;
set annolabel;
flag= 0;
xsys='2'; ysys='2'; hsys='3'; when='a';
function='label'; color='black'; size=2.5;
if id not in (ab, md, un, cd)  then 
	do;
		text=incidence; position='5'; 
		output;
	end;
else if id in (ab, md, un, cd)then 
	do;
	text=incidence; position='6'; output;
    function='move'; text=''; position=''; 
	flag=1;output;
end;

if  flag=1 then 
	do;	
        position=''; text=''; 
		function='draw'; size=.25; 
		flag=0;output;
	end;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;here ist the maplabel data.&lt;/P&gt;&lt;P&gt;I want some labels to go outside the map and use arrows to label them&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 09:49:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/460411#M15883</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-05-08T09:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/460954#M15898</link>
      <description>&lt;P&gt;I'm still counting on any help&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 11:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/460954#M15898</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-05-09T11:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/465128#M16026</link>
      <description>&lt;P&gt;Do you have the lat/long coordinates for where you want the labels to be placed, and where you want the arrows to point to?&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 15:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/465128#M16026</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-05-25T15:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/467312#M16072</link>
      <description>&lt;P&gt;Hello Robert,&lt;/P&gt;&lt;P&gt;thanks for your reply.&amp;nbsp; Its about the same datasets you helped me to solve on this link:&lt;/P&gt;&lt;P&gt;&lt;A title="using colors/formats gmap" href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yes I have the latitudes and longitudes in the test.sas7bdat&lt;/P&gt;&lt;P&gt;I tried to follow your example but I could unfortunately solve the problem. I will be glad if you can help me here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the datasets again but they are the same as that on this link:&lt;/P&gt;&lt;P&gt;&lt;A title="using-colors-on-maps(gmap)" href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728" target="_self"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/using-colors-on-maps-gmap/m-p/457338#M15728&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 08:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/467312#M16072</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2018-06-04T08:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: using arrows to label provinces on map (gmap)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/468036#M16093</link>
      <description>&lt;P&gt;My latest example also shows a couple of variations on the technique of labeling areas on a map:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd98/guatemala_volcanoes_info.htm" target="_blank"&gt;http://robslink.com/SAS/democd98/guatemala_volcanoes_info.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd98/guatemala_volcanoes.htm" target="_blank"&gt;http://robslink.com/SAS/democd98/guatemala_volcanoes.htm&lt;/A&gt;&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="guatemala_volcanoes.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21065iE26EBE48A534A0D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="guatemala_volcanoes.png" alt="guatemala_volcanoes.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-arrows-to-label-provinces-on-map-gmap/m-p/468036#M16093</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-06-06T13:01:28Z</dc:date>
    </item>
  </channel>
</rss>

