Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Identifying label inside the individual graph


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: Identifying label inside the individual graph
Date   Thu, 22 Dec 2005 09:51:29 +0100

Mosca, Ilaria wrote:
> I am creating a graph bar and I've specified the option -by (category
> nearesthospital).
> The variable category takes values from 1 to 6; nearesthospital from 1
> to 3.
>
> I defined the labels with the following command:
> #delimit;
> label define category 1 "general" 2 "academic" 3 "regional" 4 "clinic" 5
> "nursing home" 6 "rural",add
> 	;
> #delimit cr
>
> Subsequently I run the following command:
> #delimit ;
> graph bar (sum) popwithin15 popwithin30 popwithin45 popwithin60 if
> nearesthospital<=3 & category<=6,
> 	by(category nearesthospital, rows(6)
> 	title ("% of population living within 15-30-45-60 minutes from a
> medical institution", size(small))
> 	note("Source: NZa, 2006", size(vsmall)))
> 	legend (size(vsmall) label(1 "In 15 minutes")label(2 "In 30
> minutes")label(3 "In 45 minutes")label(4 "In 60 minutes"))
> 	ysize(15) xsize(15)
> 	;
>  #delimit cr
>
> However, the labels inside the individual graph keep being numbers,
> namely 1-2-3-4-5-6. If I run the command -label list, I see that they
> all are correctly specified. But why don't I see them in my graph?

Works nice for me. Did you forgot to attach the label to the variable? Do you 
see the labels in the output of -tab category-? If not state

. label value category category

Aside: note that you can somewhat simplify your legend with 

legend(size(vsmall) 
       order(1 "In 15 minutes" 2 "In 30 minutes" 3 "In 45 minutes" 
             4 "In 60 minutes"))

Many regards
Uli

-- 
[email protected]
+49 (030) 25491-361
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index