Shifting Map Graphic

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Shifting Map Graphic

Hello all I am trying to create a SAS map and need to offset the map graphic. I need to shift the map up a little bit so I can fit the legend. How do I shift my map up? I tried using vorigin=20 cm but it just seemed to distort the map. The code I an using is below. Thanks

goptions reset=all

device=png

htext=1

xpixels=2400

ypixels=1800;

pattern1 v=s c=CXFFFFFF;

pattern2 v=s c=CXC3E9FF;

pattern3 v=s c=CX87D3FF;

*pattern4 v=s c=CX4BBDFF;

pattern4 v=s c=CX0FA7FF;

pattern5 v=s c=CX0085D2;

pattern6 v=s c=CX005F96;

legend1 across=2

cborder=black

origin=()

position=(bottom right inside)

mode=protect

label=("Per 10,000 Population")

shape=bar(2,1);

title h=2 f=duplex ' By County';

footnote justify=left move=(2,1.5) 'Source, As of May 2015';

proc gmap data=state.freq map=state.st;

    id county;

    choro per_capita / discrete

    legend=legend1

    coutline=black;

    format per_capita percapita.;

run;

quit;


Accepted Solutions
Solution
‎05-08-2015 11:21 AM
Super User
Posts: 10,458

Re: Shifting Map Graphic

You may be running into a number of not-very-obvious interactions. Also which ODS destination and style are you using?

Some of the settings in the style that affect title text may get interpreted as percent of graphics area or if you are using appearance options in the title statement. Also whether you have the GTITLE or NOGTITLE option.

For a quick test I would try the output with both of these options. Also the ODS USEGOPT/NOUSEGOPT may have some affect.

Another place to look would be goptions HTITLE <height for first line of title> and

GUNIT <the unit that is used for default when assigning space >

View solution in original post


All Replies
Super User
Posts: 10,458

Re: Shifting Map Graphic

The options depend on why you need to move anything. Change to mode=reserve in the legend and the map will be drawn in slightly reduced space with the legend outside. If the legend is "large" you might be looking at moving the location elsewhere depending on your map shape. Or possibly using the OFFSET option in the legend definition.

Contributor
Posts: 45

Re: Shifting Map Graphic

My issue is that I think the legend looks the best in the bottom right corner. There is a lot of empty space between the map and the title. I've already tried moving the legend so that it fill up the empty space between the title and the map but I would rather move the map up to fill in the empty space and place the legend in the bottom right corner.

Contributor
Posts: 45

Re: Shifting Map Graphic

I forgot to mention I tried the mode=reserve. While it makes it so the legend and map don't overlap they are practically touching and I still have my issue of blank space between the title and map.

Contributor
Posts: 45

Re: Shifting Map Graphic

It is a map of Kansas if that helps.

Super User
Posts: 10,458

Re: Shifting Map Graphic

I am confused about reference to "Title" and "Legend" and spaces.

If the OFFSET options on Legend won't get you what you are looking for with regards to the position of legend and/or title statements you may want to consider Annotate to create to create them as you have absolute placement control.

I fairly often use Annotate to create legends because I am using a combination of symbol size, shape and color to provide multiple values into a single marker. So I generate one "legend" to describe the shapes, one for the colors and one for the size.

If you could post an image of what you are getting it may help as verbal descriptions of pictures is very imprecise.

Contributor
Posts: 45

Re: Shifting Map Graphic

This isn't my data so I don't want to post the original picture but here is the map. I have the title legend and source were I want them to be but there is a lot of blank space between the map and the title. I want to move the map so it is closer to the title. I have tried filling in the empty space with the legend but I didn't think it looked very good. Would changing the aspect ratio bring the title and map closer together?

map.png

Solution
‎05-08-2015 11:21 AM
Super User
Posts: 10,458

Re: Shifting Map Graphic

You may be running into a number of not-very-obvious interactions. Also which ODS destination and style are you using?

Some of the settings in the style that affect title text may get interpreted as percent of graphics area or if you are using appearance options in the title statement. Also whether you have the GTITLE or NOGTITLE option.

For a quick test I would try the output with both of these options. Also the ODS USEGOPT/NOUSEGOPT may have some affect.

Another place to look would be goptions HTITLE <height for first line of title> and

GUNIT <the unit that is used for default when assigning space >

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 314 views
  • 0 likes
  • 2 in conversation