Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • two-y-axes

    hello, I try to show my results based on two y-axes but the results are not satisfactory in the graph, they have to be on two different scales. there could be something wrong with which I had the problem. I appreciate receiving your advice.

    Code:
    cd "E:\paper-thesis\MyProject - Copy/"
    
    foreach v in "ltotalfertility" {    
    clear
    use "E:\paper-thesis\MyProject - Copy/d`v'all.dta"
    
    twoway (line  _b_d_wpui time2 , lcolor(blue) lwidth(medthick) yaxis(1) ) ///
    (rarea high_d_wpui low_d_wpui time2 , mstyle(p1) lpattern(dash) lwidth(medthick) color(blue%10) yaxis(1) ytitle("∆WPUI" , axis(1)) ylabel(,alternate) )  ///
    (line  _b_d_pp2 a time2  , lcolor(red) lwidth(medthick) yaxis(2)) ///
    (rarea high_d_pp2 low_d_pp2 time2 , mstyle(p1) lpattern(dash) lwidth(medthick) color(red%10) scheme(color) yaxis(2) ytitle("Pandemic Recession" , axis(2))  ///
    xtitle("Periods after Pandemic Recession") ylabel(,alternate) xlabel(-1(1)5) title(shock) graphregion(color(white)) plotregion(color(white)) ///
    legend(order(1 "∆WPUI" 3 "Pandemic Recession")) ///
    title( response of total fertility rate (%) to P.R v.s ∆WPUI) xtitle("Years after the Shock"))
    }

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	104.6 KB
ID:	1663373



    many thanks ,
    regards,
Working...
X