Announcement

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

  • Reduce margins in combined plot when iscale is tricky

    Dear all,

    I am trying to reduce the margins after "graph combine" when having two graphs that have different iscales.

    I have seen the posts which propose defining iscale(X) to reduce the margins, but that is not workable I am seeking to combine 2 graphs where graph1 has an iscale of 1.5 and graph2 has an iscale of 1. I would like them to have the same height and contain a 45 degree line (which means they'll differ in width)

    This is what I am using thus far, but it does leave a white margin between the two graphs.

    Code:
    scatter var var2, aspectratio(1) xlabel(0(.2)1) ylabel(0(.2)1.5) graphregion(margin(zero)) , name(A,replace) ///
    scatter var var3, aspectratio(1) xlabel(0(.2)1) ylabel(-0.5(.2)0.5) graphregion(margin(zero)) , name(B,replace) ///
    
    graph combine A B , rows(1) altshrink graphregion(margin(zero)) imargin(b=0 t=0) xsize(30) ysize(15)
    Many thanks in advance!
Working...
X