Data visualization with SAS programming

Proc gmap

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 90
Accepted Solution

Proc gmap

Hi SAS Communities,

 

Is there is anyway to place the display of numbers right side or the left side of the map. (age 20-20 26-26 28-32 below the map, is there is anyway to palce it right side or left side of the map )

Below is my code

 

data response_data;
input idname$ X Y age;
cards;
Cuba -20722.00205 4678.3461646 20 24
Guatemala -21079.71903 4444.6666525 26
Haiti -20480.41176 4569.4493199 28
Honduras -20942.88097 4419.9807239 32
;
run;

proc template;
define style styles.colorramp;
parent=styles.pearl;
style twocolorramp / startcolor=cxF3F7FE endcolor=cx6497EB;
end;
run;
data anno;
length function style color $ 10 position $ 1 text $5;
retain flag 0 function 'label' xsys ysys '2' hsys '3' when 'a' ;
set response_data ;
color= 'black';
text=put(age,comma5.);
position = '5' ;
size = 2.5;
style = "Cumberland AMT";
output;
run;
proc gmap data=response_data map=mapsgfk.world;
id IDNAME;
choro age/annotate=anno coutline=grayaa xsize = 2 in ysize = 2 in;
run;
quit;

 

Thanks & Regards,

Sanjay


Accepted Solutions
Solution
‎10-26-2016 04:04 AM
Grand Advisor
Posts: 9,713

Re: Proc gmap

The LEGEND statement controls the location and appearance of your map values.

You can have multiple legends assigned so you will also need to specify the desired definition you want in the gmap code.

 

Something like

Legend1 position=(top left outside) /* puts the location to the top left of the map on the outside*/

               across = 1                        /* how many columns of values, 1 means a single column and will appear vertically*/

;

Then in your CHORO statement add the option Legend=Legend1

such as:

choro age/  annotate=anno 
            coutline=grayaa 
            xsize = 2 in 
            ysize = 2 in
            legend=legend1
;

View solution in original post


All Replies
Solution
‎10-26-2016 04:04 AM
Grand Advisor
Posts: 9,713

Re: Proc gmap

The LEGEND statement controls the location and appearance of your map values.

You can have multiple legends assigned so you will also need to specify the desired definition you want in the gmap code.

 

Something like

Legend1 position=(top left outside) /* puts the location to the top left of the map on the outside*/

               across = 1                        /* how many columns of values, 1 means a single column and will appear vertically*/

;

Then in your CHORO statement add the option Legend=Legend1

such as:

choro age/  annotate=anno 
            coutline=grayaa 
            xsize = 2 in 
            ysize = 2 in
            legend=legend1
;
SAS Employee
Posts: 170

Re: Proc gmap

Or are you talking about an Annotate number?

If you are talking about annotate, the "position" variable determines where that is written.

http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#annotate_position...

 

Frequent Contributor
Posts: 90

Re: Proc gmap

Thank you Ballardw, thats working for me.

Post a Question
Discussion Stats
  • 3 replies
  • 259 views
  • 0 likes
  • 3 in conversation