0

我使用此代码完成了以下图表:

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)

这是输出。图例与图形区域重叠,看起来不太好。关于如何在不使图例大小/字体更小的情况下阻止这种情况的任何想法?

谢谢!!

mdp

4

0 回答 0