I have two graphs and I need to combine the two. The idea is to show a break between the series lotsize2 and floorspace. Both graphs have two lines each and I want the legend for all 4 lines at the bottom. I have tried graph combine and grc1leg2 both but they only pick the legend from one of the two not both. Here is my code. Any help is appreciated.
line lotsize2 year, xscale(off) ylabel(12000(500)14000, ang(h) labsize(vsmall)) ytitle("") lpattern(dash) || ///
line rooms year, xscale(off) yaxis(2) ylabel(4(0.5)6, ang(h) labsize(vsmall) axis(2)) ytitle("", axis(2)) lpattern(solid) graphregion(color(white)) name(gr1,replace)
line floorspace year, ylabel(1500 "1500 " 2000 "2000 " 2500 "2500 " 3000 "3000 " 3500 "3500 ", ang(h) labsize(vsmall)) ytitle("") lpattern(shortdash_dot) yscale(range(1500 3500)) || ///
line bedrooms year, yaxis(2) ylabel(1.5(0.5)3.5, ang(h) labsize(vsmall) axis(2)) ytitle("", axis(2)) color(black%33) lpattern(solid) yscale(range(1.5 3.5) axis(2)) graphregion(color(white)) name(gr2,replace)
grc1leg2 gr1 gr2, rows(2) imargin(tiny) commonscheme l1title("square feet", size(small)) graphregion(color(white))
graph combine gr1 gr2, rows(2) imargin(tiny) commonscheme l1title("square feet", size(small)) graphregion(color(white))
line lotsize2 year, xscale(off) ylabel(12000(500)14000, ang(h) labsize(vsmall)) ytitle("") lpattern(dash) || ///
line rooms year, xscale(off) yaxis(2) ylabel(4(0.5)6, ang(h) labsize(vsmall) axis(2)) ytitle("", axis(2)) lpattern(solid) graphregion(color(white)) name(gr1,replace)
line floorspace year, ylabel(1500 "1500 " 2000 "2000 " 2500 "2500 " 3000 "3000 " 3500 "3500 ", ang(h) labsize(vsmall)) ytitle("") lpattern(shortdash_dot) yscale(range(1500 3500)) || ///
line bedrooms year, yaxis(2) ylabel(1.5(0.5)3.5, ang(h) labsize(vsmall) axis(2)) ytitle("", axis(2)) color(black%33) lpattern(solid) yscale(range(1.5 3.5) axis(2)) graphregion(color(white)) name(gr2,replace)
grc1leg2 gr1 gr2, rows(2) imargin(tiny) commonscheme l1title("square feet", size(small)) graphregion(color(white))
graph combine gr1 gr2, rows(2) imargin(tiny) commonscheme l1title("square feet", size(small)) graphregion(color(white))
Comment