Statalist The Stata Listserver


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

RE: st: RE: Graph twoway: Multiple axis and order of plots


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Graph twoway: Multiple axis and order of plots
Date   Fri, 7 Jul 2006 06:15:33 -0500

If I am following this thread correctly, it appears that the only way to
draw a line plot on top of bar plot, with the y-axis for the line plot on
the left, is to -ytitle- and -ylabel- the left and right y-axes by hand:

sysuse auto,clear
gen t = _n
twoway bar trunk t, bc(gs12) yaxis(2) /// 
|| line gear t, lc(blue) lw(medthick) yaxis(1)  ||, /// 
 ylabel(5 "2.00" 10 "2.50" 15 "3.00" 20 "3.50" 25 "4.00" , axis(2)) ///
 ytitle(Gear Ratio, axis(2)) /// 
 ylabel(2 "5" 2.5 "10" 3 "15" 3.5 "20" 4 "25", axis(1)) /// 
 ytitle(Trunk space (cu. ft.), axis(1))

Scott



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