Statalist


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

st: RE: re: x and y axis in the middle


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: re: x and y axis in the middle
Date   Sun, 18 Oct 2009 17:57:14 +0100

This assumes, understandably, that your background is white, so that you
want visible but unobtrusive grid lines, so typically choose light gray.


In the book I mentioned earlier, Hadley Wickham uses as a default a
light gray background colour and so white grid lines. You don't need the
book, as you can find examples in various places e.g.
<http://had.co.nz/ggplot2/resources/2007-past-present-future.pdf> 

I quite like Wickham's style as refreshingly different, although not for
always. He is talking about a package for R, but the same kind of look
is easy in Stata: 

sysuse auto
#delimit ; 
scatter mpg weight, 
plotregion(color(gs14)) 
xla(, grid glcolor(white))
yla(, grid glcolor(white))
xsc(lcolor(gs14)) 
ysc(lcolor(gs14)) 
yla(, ang(h));  

Of course, nothing is compulsory here. If you don't like it, change it
or ignore it! 

Nick 
[email protected] 

Kit Baum

Nick said

Somewhat in his spirit, here is one variation on Kit's style:

... yline(0, lstyle(grid) lw(*2)) xline(0, lstyle(grid) lw(*2))

That is,

1. You can make the extra -yline()- and -xline()- have the same style as
your grid lines.

2. But you can also make them a little more prominent by changing the
width.


Very nice. One thing that you might want to add is something like    
lcolor(gs13)   to make the axes just a bit more prominent than the  
rest of the grid. If you want them even more noticeable, use a number  
lower than 13, and v.v.


*
*   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