Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: how to align the "baseline" (0) of 2 y axes?


From   László Sándor <[email protected]>
To   [email protected]
Subject   st: how to align the "baseline" (0) of 2 y axes?
Date   Sun, 23 Oct 2011 15:44:00 -0400

Hi,

I am plotting bond and stock returns in Stata/SE 11.2 for Mac. Because
stock return are on a different scale some years, I had to plot them
against different y axes (and I could not even simply yscale(log) it
as sometimes the market went down…). But if I simply call for two
different y axes, the levels of zeros do not line up.

twoway (tsline close_bonds close_mortgage, ytitle("%", axis(1)))
(tsline return_close_stock, yaxis(2) ytitle("%", axis(2))), ///
	legend(row(1) label(1 "Bonds") label(2 "Mortage bonds") label(3 "Stocks"))

I know the graph will be somewhat confusing because of the scale
change, but I would still keep the series in a single plot. How could
I make the zero levels line up (i.e. coincide on both the left and
right axis)?

Thank you,

Laszlo

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index