Announcement

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

  • Different colors for graph bars

    Hello,

    I have a basic doubt. I am trying to plot a graph on GDP per capita which has 2 bars- one for OECD and another for non OECD countries. I want to have two different colors for each bar group. But, the following command gives me the same color bar for OECD and non OECD countries.

    graph bar (mean) wb_gdppercap, over(OECD,relabel(1 "Non OECD" 2 "OECD")) title("GDP per Capita")ytitle("GDP per capita") bar(1, color(maroon) fintensity(inten80)) bar(2, color(navy) fintensity(inten60))

    Can someone please explain what I am doing wrong here? I have inserted the graph here for reference.

    Thank you very much!

    Attached Files

  • #2
    Look at the -asyvars- option.

    Code:
    help graph bar

    Comment


    • #3
      The mean over GDP per head for countries in any group has two limitations:

      1. It takes no account of population size.

      2. The distributions are so skew that medians or geometric means may be more useful.
      Last edited by Nick Cox; 25 Mar 2023, 05:43.

      Comment

      Working...
      X