I created bar charts for a variable (p1m10).
I wanted to see how the the value differs across another variable (grp).
I further wanted to see how the distribution of the variable across groups differs across genders.
And then I wanted to see these charts next to each other.
So I used the following code:
This generated the exact chart that I want:

In each of the 3 charts above, you can see 2 distributions: first for males (and other genders) and second for females.
Within each distribution, there are 3 groups, represented by a bar each.
As you can see, the group names are obscured by the small font size.
I would like to give each group a specific color, e.g. for the 3 groups, I could choose black, blue, green.
And then have a legend saying
black: group name 1
blue: group name 2
green: group name 3
However:
1. I am not sure how to change colors of individual bars
2. Since I have 3 charts combined, I am not sure how to have a single legend across them...
I wanted to see how the the value differs across another variable (grp).
I further wanted to see how the distribution of the variable across groups differs across genders.
And then I wanted to see these charts next to each other.
So I used the following code:
Code:
graph bar p1m10 , over(grp,label(labsize(vsmall) )) over(female) ytitle(Percent supporting project 1) name(percentproject1bygender) graph bar p2m10 , over(grp,label(labsize(vsmall) )) over(female) ytitle(Percent supporting project 2) name(percentproject2bygender) graph bar p3m10 , over(grp,label(labsize(vsmall) )) over(female) ytitle(Percent supporting project 3) name(percentproject3bygender) graph combine percentproject1bygender percentproject2bygender percentproject3bygender, col(3)
In each of the 3 charts above, you can see 2 distributions: first for males (and other genders) and second for females.
Within each distribution, there are 3 groups, represented by a bar each.
As you can see, the group names are obscured by the small font size.
I would like to give each group a specific color, e.g. for the 3 groups, I could choose black, blue, green.
And then have a legend saying
black: group name 1
blue: group name 2
green: group name 3
However:
1. I am not sure how to change colors of individual bars
2. Since I have 3 charts combined, I am not sure how to have a single legend across them...
Comment