Announcement

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

  • Format Bar Chart: Different Colors for Groups

    Hi guys,

    total Stata newbie here.
    I am currently trying to format a bar chart, which is grouped by two categories "bm" and "me" which both have values from 1 to 5.
    To distinguish better within the 2nd grouping, it would be nice to have different colors for each group value (1-5).
    Since all bars (all 25) have the same variable ("ret"), I was only able to change the color for all of them, but not individually or for a specific group value.

    Any suggestions for a desperate beginner?

    To create the bar chart I used the following code:
    Code:
    graph bar (mean) ret, over(bm) over(me)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	59.6 KB
ID:	1426744



    Thanks in advance!

  • #2
    Code:
     
     graph bar (mean) ret, over(bm) over(me) asyvars

    Comment


    • #3
      See also

      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

      which is accessible http://www.stata-journal.com/sjpdf.h...iclenum=gr0049

      Comment


      • #4
        Thank you very much guys!

        Comment

        Working...
        X