Hi everyone!
I am trying to combine two graphs and add a single legend, as their respective legends are identical.
I already looked at this ( https://www.stata.com/statalist/arch.../msg00931.html ) post, but couldn't find the answers to my questions.
In the code below I would like the combined graph to show the same legend that Graph2 has. If I leave the code just as it is, Stata generates an image with two graphs and one legend, but one of the graphs is wider than the other due to
.
Any help is very appreciated!
I am trying to combine two graphs and add a single legend, as their respective legends are identical.
I already looked at this ( https://www.stata.com/statalist/arch.../msg00931.html ) post, but couldn't find the answers to my questions.
In the code below I would like the combined graph to show the same legend that Graph2 has. If I leave the code just as it is, Stata generates an image with two graphs and one legend, but one of the graphs is wider than the other due to
Code:
legend(off)
Code:
Graph bar CashtoAt, over(taxuncty) asy bar(1, color(gs4)) bar(2, color(gs12)) graphregion(color(white)) title("Mean Cash-to-Assets", size(medium) position(6)) yti("") ylabel(,angle(0)) ylabel(,format(%5.4fc)) ylabel(0.0000(0.0500)0.2200) legend(off) graph save Graph1.gph, replace graph bar (median) CashtoAt, over(taxuncty) asy bar(1, color(gs4)) bar(2, color(gs12)) graphregion(color(white)) title("Median Cash-to-Assets", size(medium) position(6)) yti("") ylabel(,angle(0)) ylabel(,format(%5.4fc)) ylabel(0.0000(0.0500)0.2200) legend(order(2 1))legend(rows(2)) legend(region(lwidth(none))) legend(bm(left)) legend(symxsize(*1)) legend(position(3)) graph save Graph2.gph, replace graph combine Graph1.gph Graph2.gph graph export Figure1a.png, replace
Any help is very appreciated!
Comment