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 (October 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 15 Oct 2010 09:32:01 -0400
Reply-To:     Randall Powers <powers_r@BLS.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Randall Powers <powers_r@BLS.GOV>
Subject:      PROC GPLOT question: Why is the legend not matchin up with the
              data?

Hello Folks.

I've included my code below. I'm wondering why the legend is not matching the data. For example, the first three data items are food, housing, and apparel. When you graph this and look at the legend, the line for food is down where the apparel data is. The line for housing is where the education data is. The line for apparel is where the housing data is...etc.

So why aren't the values of the legends matching up with my data, and how would i get it to do this?>

Thanks!

data ratess; input date monyy7. @8 Food @17 Housing @25 Apparel @33 Transportation @41 Medical @49 Recreation @57 Education @65 Other; format date monyy7.;

drop food housing apparel transportation medical recreation education other; q=food;Quote='Food';output; q=housing;Quote='Housing';output; q=apparel;Quote='Apparel';output; q=transportation;Quote='Transporation';output; q=medical;Quote='Medical';output; q=recreation;Quote='Recreation';output; q=education;Quote='Education';output; q=other;Quote='Other';output;

datalines; jan2009 91.7 87.4 49.7 90.2 75.2 82.6 85.4 92 feb2009 92.2 89.6 52.6 90.2 70.2 81.3 85.1 91.9 mar2009 92 90.1 53.6 90.4 77.9 82.7 85.9 91.9 apr2009 91.7 90.9 54.3 90.9 71.6 82.6 86.1 92.3 may2009 91.5 90.3 55.8 90.9 75.6 82.6 85.1 91.7 jun2009 91.3 90.3 55 90.4 70.6 83.2 83.9 90.6 jul2009 90.9 90.4 52 90.4 74.6 82.6 83.4 90.7 aug2009 91.3 91.1 53.4 89.4 71.2 82.7 84.4 90.5 sep2009 91.7 90.4 54.4 88.8 74.9 84 86.3 91.3 oct2009 91.7 90.9 57.2 88.2 72.7 82.9 86.4 91.6 nov2009 91.1 88.6 56.5 88.5 72.6 81.5 86.7 91.1 dec2009 91.3 88.6 55 88.2 71.7 79.8 86.9 90.5 jan2010 83.3 88.6 52.2 89.4 70.7 81.3 82.3 91.1 feb2010 91.5 87.8 53.8 87.6 69.2 81.3 87.3 91.1 mar2010 91.5 89.2 55.4 89.8 70.6 84.2 88.2 91.2 apr2010 91 89.4 58.1 90.2 67.9 83.6 88.1 90.8 may2010 91.1 89.4 56.6 90.1 68.9 84.4 88 91.1 jun2010 90.9 90.7 55.5 90.4 69.1 83.9 85.6 90.8 ;

symbol1 interpol=join ; symbol2 interpol=join ; symbol3 interpol=join ; symbol4 interpol=join ; symbol5 interpol=join ; symbol6 interpol=join ; symbol7 interpol=join ; symbol8 interpol=join ;

axis1 label=('Rate')/*length=40 order=(0.3 to 1.7 by 0.1)*/; axis2 label=('Date') /*order=(0.3 to 1.7 by 0.1)*/;

legend1

value= ('Food' 'Housing' 'Apparel' 'Transportation' 'Medical' 'Recreation' 'Edu cation' 'Other');

title1 'CPI C&S Repricing Quote Rates'; proc gplot data=ratess; plot q*date=quote / vaxis=0 to 100 by 10 vaxis=axis1 haxis=axis2 cvref=blue caxis=blue ctext=red legend=legend1; run; quit;


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