Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Thanks - Crowded axis title and labels


From   Ramani Gunatilaka <[email protected]>
To   [email protected]
Subject   st: RE: Thanks - Crowded axis title and labels
Date   Mon, 10 Jan 2005 00:21:54 +0000

Nick, 
Thanks so much for that. The graph looks very good now.
Cheers,
Ramani

Nick Cox <[email protected]> wrote:
> You have a variable -Years- with values 1 to 5. 
> 
> You need a variable (-years-, say) with values 
> 1980 1985 1990 1995 2002. 
> 
> You could do this some simple but tedious way 
> like 
> 
> gen years = 1980 if Years == 1 
> replace years = 1985 if Years == 2 
> replace years = 1990 if Years == 3 
> replace years = 1995 if Years == 4 
> replace years = 2002 if Years == 5 
> 
> or you could do something like 
> 
> gen years = Years
> recode years 1=1980 2=1985 3=1990 4=1995 5=2002 
> 
> or you could do something like 
> 
> gen years = cond(Years < 5, 1975 + (5 * Years), 2002) 
> 
> or you could do something like 
> 
> gen year = real(word("1980 1985 1990 1995 2002", Years))
> 
> Nick 
> [email protected] 
> 
> Ramani Gunatilaka
>  
> > Dear Nick,
> > Thanks so much. -ysc(titlegap(1))- worked a treat.
> > I take your point 3 about the gap between 1995 and 2002. The 
> > thing is, those are my survey years, so there's no data in 
> > between. If I can trouble you further, can you please tell me 
> > how I can plot time literally for this kind of data?
>  
> > Nick Cox <[email protected]> wrote:
> > > Comments on various levels: 
> > > 
> > > 1. In any paper I was reviewing or editing I 
> > > would strongly suggest changing labels like 
> > > 10.0 to 50.0 to 10 to 50, if that is the 
> > > problem. The extra ".0" is not informative
> > > or decorative. 
> > > 
> > > 2. Try the option -ysc(titlegap())-. 
> > > 
> > > 3. As in point #1 I would always recommend 
> > > plotting time literally for this kind 
> > > of data. Your last gap of 
> > > 7 years should not be plotted as equivalent 
> > > to the other gaps of 5 years. Many texts 
> > > on graphics make this point, most recently 
> > > Howard Wainer's "Graphic discovery", 
> > > Princeton U.P. 2005. 
> > > 
> > > Nick 
> > > [email protected] 
> > > 
> > > Ramani Gunatilaka
> > > 
> > > > I am trying to plot income shares by quintile for five 
> > survey years.
> > > > My problem is that the graph that the following command 
> > > > generates places the y-axis title too close to the y-axis so 
> > > > that it gets super-imposed on the axis labels and makes the 
> > > > graph looks messy.
> > > > I have looked at the graphics manual and experimented with 
> > > > the options graphregion, marginstyle, position, ring and 
> > > > justification, but have not been able to solve the problem.
> > >  
> > > > twoway (line Quintile1 Quintile2 Quintile3 Quintile4 
> > > > Quintile5 Year), ylabel(0(10.0)50.0) ytitle( "Share of Income 
> > > > %") xlabel(1 "1980" 2 "1985" 3 "1990" 4 "1995" 5 "2002") 
> > > > xtitle( "Year" ) leg(rows(1)) 
> 
> *
> *   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/
*
*   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