Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • percentage displayed in bars and moving x-axis labels for negative bars

    Is there a way to label the data above the bars as percentage?

    Also, the graph is a bit hard to read because of the last negative value. Is there a way to make it more visual (e.g. bringing the x-axis to the zero level and having the x-axis labels for negative values above the x-axis so that it does not hide the bars)?

    The code I ran for this graph was
    Code:
    separate avgv_percap_t, by(d_graf)
    
    graph bar avgv_percap_t1 avgv_percap_t2 avgv_percap_t3 avgv_percap_t4 avgv_percap_t5 ///
    avgv_percap_t6 avgv_percap_t7 avgv_percap_t8 avgv_percap_t9 avgv_percap_t10 ///
    avgv_percap_t11 if selection==1, nofill ///
    over(location, label(angle(90) labsize(small)) sort(avgv_percap_t) descending) ///
    ytitle("") yscale(off) ylab(, nogrid) ///
    blabel(total, orientation(vertical) size(small) format(%8.2f)) ///
    bar(1, bcolor(blue*1.3)) bar(2, bcolor(red*1.2)) bar(3, bcolor(black)) ///
    bar(4, bcolor(black)) bar(5, bcolor(black)) bar(6, bcolor(black)) ///
    bar(7, bcolor(black)) bar(8, bcolor(black)) bar(9, bcolor(black)) ///
    bar(10, bcolor(dkgreen)) bar(11, bcolor(dkgreen)) ///
    ysize(9) xsize(18) graphregion(color(white)) legend(off) name(graf_vpercap,replace)

    Click image for larger version

Name:	graf_vpercap.png
Views:	1
Size:	47.6 KB
ID:	1446815

    Many thanks!
Working...
X