Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: -graph twoway- and x-axis positioning


From   "Stephen P. Jenkins" <stephenj@essex.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: -graph twoway- and x-axis positioning
Date   Tue, 18 Nov 2008 19:39:49 -0000

>>>>>>>>>>>>>>>>>>>>>
An Excel-using colleague has asked me how to have the x-axis of a
twoway plot go through zero (or some other number) on the y-axis.

Consider 
	sysuse auto
	ge y = price - 5000
	* x-axis below all values (default)
	scatter y mpg	
	* line through zero; axis labelling and ticks below
	scatter y mpg, yline(0) xscale(noline)
	* ? how to force x-axis through zero ?
	
I've looked through the [G] manual, and searched the Statalist
archive, but have not yet been able to discover how to do this.  (It's
not necessarily aesthetically desirable, I know, but I have been
presented with the 'challenge'.)
----
Do you mean you want ticks and x-axis labels superimposed within the
data region? I'd refuse to play, regardless of whether it can be done.


Nick 
n.j.cox@durham.ac.uk 
----
You want the ticks and labels moved into the inner plot region??
Seems like a bad idea, but you could write a little pre-processing
program to accumulate the necessary ticks (lines) and labels (text) in
a local.  Is it worth the effort?
Austin Nichols
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The answer to Nick and Austin's opening questions is "yes" -- though I
strongly agree with their additional remarks about the general
undesirability of doing this (as my final sentence hinted).

The background: I am trying to persuade some sceptical colleagues to
change from using Excel for graphics to using Stata for graphics --
for reproducibility and audit trails, in addition to functionality and
'total control'.  I have been given a series of Excel graphs as
'challenges' by these colleagues, including one with this axis
feature.  This is the only thing that has beaten me so far.


Stephen
-------------------------------------------------------------
Professor Stephen P. Jenkins <stephenj@essex.ac.uk>
Director, Institute for Social and Economic Research
University of Essex, Colchester CO4 3SQ, U.K.
Tel: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk  
Survival Analysis using Stata:
http://www.iser.essex.ac.uk/teaching/degree/stephenj/ec968/ 
Downloadable papers and software: http://ideas.repec.org/e/pje7.html

Learn about the UK's new household panel survey, "Understanding
Society": http://www.iser.essex.ac.uk/ukhls/ 


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index