Statalist


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

Re: st: number format in graph labels


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: number format in graph labels
Date   Wed, 13 Aug 2008 12:17:07 -0400

In fact, if you want to accept Stata's default axis, in the graph command, you need only specify: ylabel(, valuelabel)

Also,

label values weight

will remove the value label from the variable weight without dropping the label.

-Steve

On Aug 13, 2008, at 12:05 PM, Steven Samuels wrote:


You can create a new label for the values you want to show on the graph
/ ********************************************************************** /
sysuse auto,clear

label define gwt000 0 "0" 1000 "1" 2000 "2" 3000 "3" 4000 "4" 5000 "5" ///
6000 "6" 7000 "7" 8000 "8" 9000 "9" 10000 "10"
label values weight gwt000
twoway scatter weight trunk, ylabel(0 1000 2000 3000 4000 5000, valuelabel) ytitle("Weight (1,000's of Pounds)")

/ ********************************************************************** /
help -label- will show you how to save such temporary labels for further use. Note that you can make the label go as high as you like, but use only a subset of values in the -ylabel- option.

-Steve

On Aug 13, 2008, at 11:29 AM, Maarten buis wrote:


--- Gisella Young <[email protected]> wrote:
It occurs to me that a (hopefully) simpler way might just be to title
the y-axis "Whatever (thousands)" or "Whatever ('000)" and then have
the labels all divided by a thousand, so what would have been 1000000
would just be 1000, in which case the absence of spaces doesn't
really matter as the smaller number of 0's is easy to see. However
I'm not sure if there is an easy way of doing this (in my pre-Stata
life I made a lot of graphs in Excel and there is an option to tick
to show the graph scale in 100's, 1000's, etc). I don't want to
actually divide my y variable by 1000 as i still want the original
variable to be used in plotting the chart, but just want to show the
variable graphically in '000's - is there a way to do this in Stata?
This is exactly what I would do. If you think carefully about it, an
option that removes three zeros from the y-axis labels does exactly the
same thing as dividing your y by 1000 and use that variable for the
plot.

-- Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

Send instant messages to your online friends http:// uk.messenger.yahoo.com
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/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/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/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