Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: How to show variable label in a graph title
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: How to show variable label in a graph title
Date
Thu, 24 Oct 2013 17:14:07 +0100
We can't explain what you did wrong without sight of code. As the
variable here is -percent-, you could just go
title("`: var label percent'")
but if local macro 1 contains the variable name, this should work too:
title("`: var label `1''")
Some minor tricks of the trade can be seen by looking inside -aaplot-
(SSC) and -multqplot- (SJ).
Nick
[email protected]
On 24 October 2013 17:08, Song, Lin <[email protected]> wrote:
> Hi Stata experts,
>
> I'm generating graphs using a dialog program I created. In the following command, the title is the variable name. However, I would like the title to be the variable label.
>
> twoway (bar percent demoseq) (rcap upper_ci lower_ci demoseq), title("`1'") xlab(#29) ylabel(#5) ytitle("percent") legend(off)
>
> I tried using macro to show the variable label for `1' but could not make it work.
>
> Do you have a solution for this?
>
> Thanks a lot.
>
> Lin
>
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/