Bookmark and Share

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.


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

Re: st: multiple y-axes


From   "Michael N. Mitchell" <Michael.Norman.Mitchell@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: multiple y-axes
Date   Wed, 01 Sep 2010 20:33:28 -0700

Maybe this will do the trick?

twoway (histogram osteocalcin, width(5) yaxis(1))  ///
       (line hr TOC, yaxis(2))


Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



On 2010-09-01 7.53 PM, Kieran McCaul wrote:
...

I'm trying to overlay a line graph and a histogram, so I used this:

twoway (line hr TOC, yaxis(1)) ///
        (histogram osteocalcin, width(5) yaxis(2))

This gives me the y-axis for hr on the left and the y-axis for the
histogram on the right which is what I want, but the histogram is over
the top of the line.

OK, so then I tried:
twoway (histogram osteocalcin, width(5) yaxis(2))  ///
        (line hr TOC, yaxis(1))

Now the line is on top of the histogram (good), but the y-axes have
swapped.  Now the hr axis is on the right  and the histogram axis is on
the left.

So my question: how can if get my axes where I want them and have the
line over the top of the histogram?

Thanks.



______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health&  Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: Kieran.McCaul@uwa.edu.au
http://myprofile.cos.com/mccaul
http://www.researcherid.com/rid/B-8751-2008

"You don't win friends with salad" - Homer Simpson on vegetarianism
________________________________________________________________________
__
IMPORTANT: This email is intended for the use of the individual
addressee(s) named above and may
contain information that is confidential, privileged or unsuitable for
overly sensitive persons with low
self-esteem, no sense of humour or irrational religious beliefs. If you
are not the intended recipient,
any dissemination, distribution or copying of this email is not
authorised (either explicitly or implicitly)
and constitutes an irritating social faux pas.


*
*   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/
*
*   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   |   Site index