Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Including variable labels in graph titles


From   Dick Campbell <[email protected]>
To   "statalist-hsphsun2.harvard.edu" <[email protected]>
Subject   st: Including variable labels in graph titles
Date   Sat, 21 Oct 2006 15:08:49 -0500

I need to produce a sequence of twoway overlay graphs for a set
of variables, say x1 x2 .... xk. Each variable has a label, e.g.
x1 "Label for variable x1" . I have written a do file which cycles
through the variables nicely using a foreach command, but I want to
include the label of the yaxis variable in the title of the variable.
I can't seem to find a way to capture the variable label so that it
can be embedded in the title. If there were some routine in Stata
that returned the label in a macro I could run it quietly, recover
the label and easily embed it in the title, but there doesn't seem to
be one. Does anyone have any ideas as to how this might be done?
Essentially, I want to this:

twoway (scatter mpg weight, sort), title(Scatter plot for (variable label to be inserted here).)
*
* 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