Dear all,
I'm having some problems with a graph that is generated through a double for. In particular, I'm generating a graph for each of 11 different countries and conditioning the variables to three different categories of tenure. This is the code I'm dealing with
the problem is that it generates me images with different labels of the yaxis (the xaxis is not a problem since the time period is the same for every country), not allowing me for an easy comparison.
Of course I know that STATA uses the maximum value of one of the variables that you put inside and rescale the axis to that, but I'm asking, is it possible, in a for cycle like the one I posted, to have a yaxis that is constant for the different tenures level within the country (the axis between countries can even change since that some of them are very different)?. The Idea would be to take the maximum level of the variables in the legend between the three different tenures, and to refer to that for each country. How can I do that?
Thank you very much
I'm having some problems with a graph that is generated through a double for. In particular, I'm generating a graph for each of 11 different countries and conditioning the variables to three different categories of tenure. This is the code I'm dealing with
Code:
local save_path "C:\Users\39333\Desktop\ECB CES\graphs\expectations, country and tenure" local countries "AT BE DE EL ES FI FR IE IT NL PT" foreach tenure_class in 1 2 3 { foreach country in `countries' { twoway /// (line E_i_mortg1y_pe wave if country == "`country'" & tenure == `tenure_class', lcolor(blue) lpattern(solid)) /// (line Euro_cost_of_mortgage wave if country == "`country'" & tenure == `tenure_class', lcolor(blue) lpattern(dot)) /// (line E_P1y_pe wave if country == "`country'" & tenure == `tenure_class', lcolor(red) lpattern(solid)) /// (line P_P1y_pe wave if country == "`country'" & tenure == `tenure_class', lcolor(green) lpattern(solid)) /// (line CPI_overall wave if country == "`country'" & tenure == `tenure_class', lcolor(red) lpattern(dot)) /// (line E_unempl_1y_pe wave if country == "`country'" & tenure == `tenure_class', lcolor(black) lpattern(dash) yaxis(2)), /// title("Various Exp. -`country'- Tenure `tenure_class'") /// xtitle("Waves") ytitle("Rates") ytitle("E_unemp", axis(2)) /// ylabel(0(2)12) ylabel(0(5)30, axis(2)) /// legend(order(1 "E_mortg" 2 "Cost_mortg" 3 "E_prices1y" 4 "P_prices1y" 5 "CPI" 6 "E_unemp")) graph export "`save_path'/various_exp_`country'_tenure`tenure_class'.png", replace } }
Of course I know that STATA uses the maximum value of one of the variables that you put inside and rescale the axis to that, but I'm asking, is it possible, in a for cycle like the one I posted, to have a yaxis that is constant for the different tenures level within the country (the axis between countries can even change since that some of them are very different)?. The Idea would be to take the maximum level of the variables in the legend between the three different tenures, and to refer to that for each country. How can I do that?
Thank you very much
Comment