[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: how to make the X axis increment by a certain value
At 16:04 23/11/2005, HW wrote:
You might like to use the -regaxis- package, which you can download from
SSC within Stata using the -ssc- command. If you do this, and type
I know in Stata allows us to set the axis like xlabel(1(1)10), but if
I am running a loop and the min and max of X axis vary from graph to
graph, can I tell Stata to label X axis at every 1 value of X (or
every 2) without specifying the min. and max. of X? I am sure there is
a way to do it in Stata.
regaxis x, cycle(2) ltick(xlabs)
twoway scatter y x, xlabel(`xlabs')
then -regaxis- will store in the macro xlabs a sequence of x-axis labels,
spanning the range of x and separated by a cycle length of 2, and -twoway
scatter- will use `xlabs' as the X-axis labels.
The -regaxis- package is a general solution to creating regular axis label
sequences and ranges, which can either be linear (using the -regaxis-
program) or logarithmic (using the -logaxis- program). You can find more
about it by typing
and reading the on-line help.
I hope this helps.
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Opinions expressed are those of the author, not the institution.
* For searches and help try: