Statalist The Stata Listserver


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

Re: st: horizontal gridlines in scheme lean1?


From   vwiggins@stata.com (Vince Wiggins, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: horizontal gridlines in scheme lean1?
Date   Wed, 20 Sep 2006 10:12:36 -0500

Christopher W. Ryan <cryan@binghamton.edu> wants Svend Juul's <SJ@SOCI.AU.DK>
lean1 and lean2 graphics schemes to remove the grid lines on box plots.  He
writes,

> My lean1 boxplots have horizontal gridlines, which I'd like to get
> rid of.  Running Stata 8 on Win98, updated.  My lean scheme package
> is gr0002_3.  Am I doing something wrong?

Svend goes on to write,
 
> Not your fault. And not the fault of scheme lean1; even scheme
> s1mono includes horizontal grid lines in boxplots. But you can drop
> the grid lines:
>
>  sysuse auto graph box mpg, medtype(line) over(foreign) ylabel(, nogrid)
>
> P.S: StataCorp: I don't know why -graph box- includes horizopntal
> gridlines regardless of scheme. Please consider.

Drawing grid lines is intentionally graph-family specific with the -s1mono-
scheme, as it is for the entire family of -s1- schemes.  We might argue
whether this is good, but it true.

Schemes can control whether grid lines are drawn on the scale axis of a box
plot.  What's more, they can draw the lines on horizontal box plots only, on
vertical box plots only, or on box plots of both orientations.

If Svend wants grid lines not to be drawn on vertical box plots, all he needs
to add to his lean2 scheme file is the line,

     axisstyle box_scale_vert  vertical_default

The "vert" in "box_scale_vert" may seem odd, but it refers to the fact that
the scale axis in vertical box plots is oriented vertically, though its grid
lines will indeed be horizontal.

If Svend also wants no grid lines when box plots are drawn horizontally, he
can add a second line, 

    axisstyle box_scale_horiz horizontal_default

The style "vertical_default" and "horizontal_default" in these lines instructs
the scheme to use the default axes that Svend is already controlling using
other lines in his scheme files.  He might also have specified
"vertical_nogrid" and "horizontal_nogrid" to specifically designate no grid
lines, but since his default axes do not draw grid lines, it doesn't matter.
Possible styles for this part of the entry are documented in -help axisstyle-.

What neither Chris nor Svend mention is that Svend's lean2 scheme also draws
grid lines on the scale axes of bar and dot plots.  If Svend wants these
removed, he can add the following lines to his scheme file,

    axisstyle dot_scale_horiz horizontal_default
    axisstyle bar_scale_horiz horizontal_default

    axisstyle dot_scale_vert  vertical_default
    axisstyle bar_scale_vert  vertical_default

Careful readers will have noted that this means we can individually control
whether grid lines are drawn on bar graphs, box plots, dot plots, and by the
process of elimination twoway graphs.  What's more, we can control the drawing
of grid lines separately for horizontal and vertical versions of each of these
graphs.

The documentation for these scheme entries is at the bottom of 
-help scheme axes- under the heading "Overall axis styles", though admittedly
there is not much detail on their application and the reliance of grids on
axes.


-- Vince
   vwiggins@stata.com

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