Hi:
I'm trying to make a graph with two Y axis, but i have try with many ways and can't make it work. If anyone could help I would really appreciate.
The following is the command I’m using to make the graph with one Y axis:
codebook
destring year, replace
gen pais=1
replace pais=2 if( country=="Central African Republic")
replace pais=3 if( country=="New Zealand")
label define conuntrylabel 1 "Costa Rica" 2 "Central African Republic" 3 "New Zealand"
label value pais countrylabel
drop if year==.
tsset pais year
twoway tsline impor_merca if pais==1 || tsline impor_merca if pais==2 ///
|| tsline impor_merca if pais==3, ///
title("Importaciones de mercadería de Costa Rica, África Central y" ///
"Nueva Zelanda en el período 1970-2015", size(*0.85) margin(bottom)) ///
ytitle("Cantidad de importaciones en dólares", size(*0.85)) ///
xtitle("Año") ///
ylabel(0(500)4000, labsize(*0.85) angle(horizontal) format(%15.0fc)) ///
xlabel(1970(5)2015, labsize(*0.85) angle (horizontal)) ///
legend(order(1 "Costa Rica" ///
2 "África Central" 3 "Nueva Zelanda") rows(3) ///
symxsize(*0.5) region(color(none)) position(6)) ///
graphregion(color(white)) plotregion(margin(off)) ///
note("Nota: Cantidad de importaciones están en una base de diez millones." ///
"Fuente: Indicadores mundiales de desarrollo, Banco Mundial", ///
size(*1) span margin(top))
I'm trying to make a graph with two Y axis, but i have try with many ways and can't make it work. If anyone could help I would really appreciate.
The following is the command I’m using to make the graph with one Y axis:
codebook
destring year, replace
gen pais=1
replace pais=2 if( country=="Central African Republic")
replace pais=3 if( country=="New Zealand")
label define conuntrylabel 1 "Costa Rica" 2 "Central African Republic" 3 "New Zealand"
label value pais countrylabel
drop if year==.
tsset pais year
twoway tsline impor_merca if pais==1 || tsline impor_merca if pais==2 ///
|| tsline impor_merca if pais==3, ///
title("Importaciones de mercadería de Costa Rica, África Central y" ///
"Nueva Zelanda en el período 1970-2015", size(*0.85) margin(bottom)) ///
ytitle("Cantidad de importaciones en dólares", size(*0.85)) ///
xtitle("Año") ///
ylabel(0(500)4000, labsize(*0.85) angle(horizontal) format(%15.0fc)) ///
xlabel(1970(5)2015, labsize(*0.85) angle (horizontal)) ///
legend(order(1 "Costa Rica" ///
2 "África Central" 3 "Nueva Zelanda") rows(3) ///
symxsize(*0.5) region(color(none)) position(6)) ///
graphregion(color(white)) plotregion(margin(off)) ///
note("Nota: Cantidad de importaciones están en una base de diez millones." ///
"Fuente: Indicadores mundiales de desarrollo, Banco Mundial", ///
size(*1) span margin(top))
Comment