Announcement

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

  • bar graph with a specific color on a specific word?

    Dear All, Suppose we run
    Code:
    sysuse nlsw88, clear
    graph hbar wage, over(occ, sort(1)) by(union)
    We can obtain
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	102.0 KB
ID:	1725693

    I wonder if it is possible to have a red color on "Farmers" on the left panel? Thanks.
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

  • #2
    See

    Code:
    SJ-11-3 gr0049  . . . . . . . . . .  Stata tip 102: Highlighting specific bars
            . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
            Q3/11   SJ 11(3):474--477
            tip on highlighting a subset of observations in a bar or
            dot chart
    https://www.stata-journal.com/articl...article=gr0049

    Code:
    sysuse nlsw88, clear
    separate wage, by(occ == 9) veryshortlabel
    graph hbar wage?, nofill over(occ, sort(wage)) by(union, legend(off) b1title(mean of Wage))

    Comment


    • #3
      Dear Nick, Thanks a lot for this helpful suggestion. Instead of highlighting the bar as you suggested
      Click image for larger version

Name:	Graph1.png
Views:	1
Size:	101.0 KB
ID:	1725705


      Is it possible to change the color of the word "Farmers"? Thanks.





      Ho-Chuan (River) Huang
      Stata 19.0, MP(4)

      Comment


      • #4
        You can use the Graph Editor for that.

        Comment


        • #5
          Thanks, Nick. I got it.
          Click image for larger version

Name:	Graph2.png
Views:	1
Size:	97.4 KB
ID:	1725712
          Ho-Chuan (River) Huang
          Stata 19.0, MP(4)

          Comment

          Working...
          X