Announcement

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

  • Event_plot margin issue

    Hi, I am trying to combine two graphs created using `event_plot`:

    Code:
    // regression 1
    estat event, window(-4 4) estore(cs)
    event_plot cs, default_look graph_opt(xtitle("Periods since the event") ytitle("ATT") ///
        title("Var1") xlabel(-4(2)4)  legend(off)) stub_lag(Tp#) stub_lead(Tm#)  ciplottype(rcap)  plottype(scatter)
    graph save ga, replace
    
        
    // regression 2
    estat event, window(-4 4) estore(cs)
    event_plot cs, default_look graph_opt(xtitle("Periods since the event") ytitle("ATT") ///
        title("Var2") xlabel(-4(2)4)  legend(off)) stub_lag(Tp#) stub_lead(Tm#)  ciplottype(rcap)  plottype(scatter)
    graph save gb, replace
    
    gr combine ga.gph gb.gph , col(1) xcommon ysize(7) commonscheme
    The result however, has different margins on the left, I would like the plot margins to be aligned, is this possible to force?


    Click image for larger version

Name:	Screenshot 2024-12-19 032150.png
Views:	1
Size:	52.5 KB
ID:	1769722

  • #2
    Not a fix, but a workaround is to use `coefplot` instead:

    Code:
    estimates store cs
    coefplot ///
    (cs, keep(Tm4 Tm2) mcolor(maroon) ciopts(color(maroon) recast(rcap))) ///
    (cs, keep(Tp0 Tp2 Tp4) mcolor(navy) ciopts(color(navy) recast(rcap))) ///
    , vert ytitle(ATT) yline(0, lcolor(gray)) xline(2.75, lpattern(dash) lcolor(gray)) legend(off) xlabel(1 "-4" 2 "-2" 3 "0" 4 "2" 5 "4") xtitle(Periods since event)

    Comment

    Working...
    X