Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: RE: RE: RE: Graphing: How to suppress labels on second y axis

 From Nick Cox To "'statalist@hsphsun2.harvard.edu'" Subject st: RE: RE: RE: Graphing: How to suppress labels on second y axis Date Thu, 30 Sep 2010 18:04:25 +0100

```Two small points. It's a smidgen quicker and shorter to write

sum `lev'normalized, meanonly

1. -su, meanonly- despite its name yields the maximum (and some other stuff you can ignore). This is discussed at excruciating length in

SJ-7-3  st0135  . . . . . . . . . . . Stata tip 50: Efficient use of summarize
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
Q3/07   SJ 7(3):438--439                                 (no commands)
tip on using the meanonly option of summarize to more
quickly determine the mean and other statistics of a
large dataset

2. The business of putting r(max) in a local, and then reading from the local, can be shortened. This has been called "cutting out the middle macro".

Nick
n.j.cox@durham.ac.uk

McDermaid, Cameron

I've made a tweak to Nick's suggestion below.  One rationale for using 2 axes was that the primary Y axis is one scale that can vary with the data and the second Y axis is fixed from 0 -1 . Using Nick's suggested script below uses the alert's actual value (missing, 1) is plotted on the primary Y axis and is often out of scale as to be not easily seen, depending on the line graph data.

What I've done is adjust the alert value (1) to the maximum value of the data in the line plot then back to 1 once the plot is done.

e.g.

quietly: sum `lev'normalized
local maxval: display `r(max)'