title: Stata Coloring Bar graph for different categories
body: <p>I have the following bar graph and I would like to color the bar graphs (A, B, C) from category "1", to blue color. The bar graphs A,B,C from category "2" to green, "3" to yellow, "4" to brown, "5" to black...</p>
  
  <p>I'm facing a really hard time trying to understand how can I do this, since when I tried to change the colors, it changes all of them to the same color...</p>
  
  <p>my database is something like this:</p>
  
  <pre><code>ID var1 var2
  sample1 A 1
  sample2 B 1
  sample3 C 1
  sample4 C 1
  sample5 A 2
  sample6 B 3
  sample7 C 2
  sample8 A 4
  sample9 A 4
  sample10 A 5
  </code></pre>
  
  <p>To generate the graph below I've just used the command:</p>
  
  <pre><code>graph bar (count), over(var1) over(var2)
  </code></pre>
  
  <p>What I'm trying to get here is to color the groups 1, 2, 3, 4 and 5 in different colors, but the bars must be in the same color...</p>
  
  <p>e.g. A,B,C from group 1 in blue, A,B,C from group 2 in green, A,B,C from group 3 in yellow, A,B,C from group 4 in brown and A,B,C from group 5 in black... </p>
  
  <p><a href="https://i.stack.imgur.com/36N7g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/36N7g.png" alt="bar graph"></a></p>