- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input double(v1 id)
- .1812867065354394 1
- .11979404113813726 2
- .15310145083000348 3
- .08029177505430556 4
- .019067285258387193 5
- .015741907801228243 6
- .003593553058542734 7
- end
- label value id way
- label define way 1 "自己储蓄投资" 2"子女赡养" 3"社会养老保险" 4 "离退休工资" 5"商业养老保险" 6"配偶亲属支持" 7 "其他方式"
- graph bar (asis) v1, over(id) ytitle("") ///
- asyvars ylabel(0(0.02)0.2) ylabel(0 "0.00%" 0.02 "2.00%" 0.04 "4.00%" 0.06 "6.00%" ///
- 0.08 "8.00%" 0.1 "10.00%" 0.12 "12.00%" 0.14 "14.00%" 0.16 "16.00%" 0.18 "18.00%" 0.2 "20.00%",angle(0) nogrid) ///
- title("家庭养老方式选择" ,pos(6)) legend(col(1) pos(1) ring(0) size(small)) ///
- blabel(bar, position(outside) format(%9.4f) color(black)) ///
- scheme(s1mono)
效果如下:
请教黄老师及各位大牛,如何将图中柱状图上方额小数改为百分数形式,比如0.1813改为18.13%,0.1198改为11.98%?