Announcement

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

  • data label inside plot region

    Dear all,
    Is there a way to make sure that the data labels above the bars are inside the white plot region?

    The command I used to generate the graph was
    Code:
    graph bar percap_total1 percap_total2 percap_total3 percap_total4 percap_total5 ///
    percap_total6 percap_total7 percap_total8 percap_total9 if year==2015 & selection==1, ///
    over(location, label(angle(90) labsize(small)) sort(percap_total) descending) ///
    ytitle("") yscale(off) blabel(total, orientation(vertical) size(small) format(%9.0f)) legend(off) nofill ///
    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)) ///
    ysize(9) xsize(18)
    Click image for larger version

Name:	graf_percap.png
Views:	1
Size:	58.7 KB
ID:	1446544

  • #2
    s2scheme is the default scheme for graphs in Stata. You can look at help scheme for different selections. To have a white background, simply add

    Code:
     graphregion(color(white))

    Comment


    • #3
      Actually I would not like to change the colors. I would like to have the background with a light blue color and the pot region with a white color.

      Instead of changing the background color to white, I would like to make the background region smaller (by making the xlabels start all the way from the bottom) and the plot region wider. Is it possible?

      Many thanks

      Comment


      • #4
        Include the ylabel() option specifying a value that is beyond the data range, e.g.,

        Code:
        yla(10300)

        Comment


        • #5
          Many thanks Andrew

          Comment

          Working...
          X