Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

[no subject]



I would like to graph both of these series on one graph. 
They should align perfectly. On the left y-axis, I'd 
like the ticks to correspond to the values from "prices".
On the right axis, I'd like the ticks to correspond 
to the values from "PI". But graphing both series on the
same graph doesn't get them to align perfectly. (ie, 
twoway line slavepr year  || line PI  year , yaxis(2) doesn't work)

 
Nick Cox has suggested using -mylabels but I'm having problems 
with it. (see the statalist archives 
http://www.stata.com/statalist/archive/2004-02/msg00402.html  )



Here's what I tried:


mylabels 1(.2)3 , myscale(@*373.5416) local(labels) 

#delimit ;
twoway (connected slavepr  year if year<=1860 ) ,
    title("Avg price AND Index ")
    yaxis(1 2)
    ylabel(300(100)1200 , ang(h) axis(1) )
    ylabel(`labels' , ang(h) axis(2) ) ;
#delimit cr




I get the following output and error message:


. mylabels 1(.2)3 , myscale(@*373.54156) local(labels) 
373.542 "1" 448.25 "1.2" 522.958 "1.4" 597.666 "1.6" 672.375 "1.8" 747.083 "2" 
821.791
"2.2" 896.5 "2.4" 971.208 "2.6" 1045.92 "2.8" 1120.62 "3"

. 
. 
. #delimit ;
delimiter now ;
. twoway (connected slavepr  year if year<=1860 ) ,
>                 title("Avg price AND Index ")
>                 yaxis(1 2)
>                 ylabel(300(100)1200 , ang(h) axis(1) )
>                 ylabel(`labels' , ang(h) axis(2) ) ;
ylabels(  373.542 Unknown function 1"   448.25 "1.2"  522.958 "1.4"  
597.666 "1.6"  67
> 2.375 "1.8"  747.083 "2"  821.791 "2.2"    896.5 "2.4"  971.208 "2.6"  
1045.92 "2.8"
>   1120.62 "3" , ang()
r(133);




Whats up with that "Unknown function 1" bit?

Can anyone think of a workaround?

Thanks in advance.

--John


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