I have the following graphs done using this code:
legend(rows(3) size(small) bmargin(zero) rowgap(0) colgap(0) label (2 "Charcoal") label(3 "Rudimentary wood planks") label(4 "Animal dung") label(1 "Others")) ///
blabel(bar, format(%9.0f) color(white) size(vsmall) position(inside)) bargap(5) graphregion(color(white)) ytitle("Percentage %") ///
ylabel(, nogrid) b1title("") l1title("") title("Cooking fuel")
graph save "11", replace
catplot floor1 [aw=${weight}], recast(bar) percent asyvars stack ///
legend(rows(2) label(2 "Sand/Earth") label(3 "Dung") label(1 "Others") size(small) bmargin(zero) rowgap(0) colgap(0)) ///
blabel(bar, format(%9.0f) color(white) size(vsmall) position(inside)) bargap(5) graphregion(color(white)) ytitle("Percentage %") ///
ylabel(, nogrid) b1title("") l1title("") title("Floor")
graph save "22", replace
catplot watersource [aw=${weight}], recast(bar) percent asyvars stack ///
legend(rows(2) size(small) bmargin(zero) rowgap(0) colgap(0) label(1 "Other") label(2 "Public tap") label(3 "Tubewell/Borehole") label(4 "River/stream/lake")) ///
blabel(bar, format(%9.0f) color(white) size(vsmall) position(inside)) bargap(5) graphregion(color(white)) ytitle("Percentage %") ///
ylabel(, nogrid) b1title("") l1title("") title("Water source")
graph save "33", replace
catplot toilet [aw=${weight}], recast(bar) percent asyvars stack ///
legend(rows(3) size(small)) legend(label(1 "Other") label(2 "Pit latrine with slab") label(3 "Pit latrine without slab/open") label(4 "No facilities/in the bush")) ///
blabel(bar, format(%9.0f) color(white) size(vsmall) position(inside)) bargap(5) ytitle("Percentage %") ///
ylabel(, nogrid) b1title("") l1title("") title("Sanitation")
graph save "44", replace
graph combine "11" "22" "33" "44", iscale(0.8)
This is the output. The legend is overlapping the graph area and doesn't look great. Any idea on how to stop that without making the legend size/font even smaller?
Thanks!!