LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 4 Jun 2009 11:05:06 -0400
Reply-To:     msz03@albany.edu
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Zdeb <msz03@ALBANY.EDU>
Subject:      Re: PROC GMAP legend question
Content-Type: text/plain;charset=iso-8859-1

hi ... quoting Emily Litella "Never mind." ... as in my previous posting does work, but it is more effort that is actually required (via "graphics guru")

for PROC GMAP, there is a MUCH easier way to assure that all defined LEGEND entries appear in a map and that data are consistently matched to LEGEND colors, regardless of the data set content

using the same SAS code as in the previous posting, use a CHORO statement ...

choro y / discrete midpoints=5 10 20;

with one MIDPOINT per entry in the format being used to group data values the midpoints force the legend entries to be used, regardless of data content

after the last posting, this is really a "duh" moment and emulates the PRELOADFMT in GMAP

****************************************************

* 3 x 3 'map';

data squares (keep=sq x y); do j = 1 to 3; do i = 1 to 3; sq+1; y= j; x=i; output; x=i+1; output; y=j+1; output; x=i; output; end; end; run;

data x; do sq = 1 to 9; y = ceil(50*ranuni(1234))+20; output; end; run;

* groups for map data;

proc format; value yfmt low - 9 = '<10' 10 - 19 = '10-19' 20 - high = '20+' ; run;

* draw the map;

goptions reset=all;

* sequential solid patterns; pattern1 v=ms c=cxf7fcb9; pattern2 v=ms c=cxaddd8e; pattern3 v=ms c=cx31a354;

proc gmap map=squares data=x; id sq; choro y / discrete midpoints=5 10 20; format y yfmt.; run; quit;

-- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475

> I am using the DISCRETE option in the CHORO statement in PROC GMAP to generate color values for calendar maps. I don't know all possible values the > data could contain until I have read it all and it is possible that all possible values will not be represented in the data. Is there a way I can > force the legend to have all possible values even if they do not appear in the map itself? > > I apologize for the vagueness of the question and the lack of an example but reducing the data to something that could be posted here represents > something of a challenge itself. The data consists of actual measured consumption and maximum possible consumption for each observation. I need to > show the full range of possible consumption in the legend whether the actual consumption (shown in the map) actual range that high or not. > > Thanks in advance, > > Jim Horne > Systems Programmer > Large Systems Engineering & Messaging NC4IT > Lowe's Companies, Inc. > 1000 Lowe's Boulevard > Mooresville, NC > 704-758-5354 > Jim.Horne@Lowes.com<mailto:jim.horne@lowes.com> > > > > > NOTICE: > All information in and attached to the e-mail(s) below may be proprietary, confidential, privileged and otherwise protected from improper or > erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or > disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone > (704-758-1000) or by e-mail and destroy all copies of this message (electronic, paper, or otherwise). Thank you. >


Back to: Top of message | Previous page | Main SAS-L page