Hello everyone,
I have a problem with my graphics.
Objective: a bar chart that shows the differences in the correlation between income and obesity depending on gender.
Problem: I don't want the labeling of the Y axis twice for each chart but one below the whole plot.
1st -by option
graph bar X1 X2, over(incomeq, relabel(1"1" 2" 2" 3"3" 4"4" 5"5") ) by(sex, title("Proportion of obesity in income quintiles", box)) percent ytitle("Percentage") b1title("Income Quintiles") legend(order(1 "Under/Normal Weight" 2 "Overweight/Obesity") col(1) pos(2)) leg(size(small)) scheme(s2color) blabel(total, format(%9. 2f)) bargap(5)
With the -over option it works, but there I don't know how to put the descriptions "man" "woman" at the top of the diagrams, I also prefer the by option for the display if this is possible.
2nd -over option
graph bar X1 X2, over(incomeq, relabel(1"1" 2" 2" 3"3" 4"4" 5"5") ) over(sex) title("Proportion of obesity in income quintiles", box) percent ytitle("Share in percent") b1title("Income quintiles") legend(order(1 "Under/normal weight" 2 "Overweight/obese") col(1)) leg(size(small)) scheme(s2color) blabel(total, format(%9. 2f)) bargap(5)
3. problem: regardless of the choice of option, how can I customize the percentages so that they are easier to read.
thanks for your help.
I have a problem with my graphics.
Objective: a bar chart that shows the differences in the correlation between income and obesity depending on gender.
Problem: I don't want the labeling of the Y axis twice for each chart but one below the whole plot.
1st -by option
graph bar X1 X2, over(incomeq, relabel(1"1" 2" 2" 3"3" 4"4" 5"5") ) by(sex, title("Proportion of obesity in income quintiles", box)) percent ytitle("Percentage") b1title("Income Quintiles") legend(order(1 "Under/Normal Weight" 2 "Overweight/Obesity") col(1) pos(2)) leg(size(small)) scheme(s2color) blabel(total, format(%9. 2f)) bargap(5)
With the -over option it works, but there I don't know how to put the descriptions "man" "woman" at the top of the diagrams, I also prefer the by option for the display if this is possible.
2nd -over option
graph bar X1 X2, over(incomeq, relabel(1"1" 2" 2" 3"3" 4"4" 5"5") ) over(sex) title("Proportion of obesity in income quintiles", box) percent ytitle("Share in percent") b1title("Income quintiles") legend(order(1 "Under/normal weight" 2 "Overweight/obese") col(1)) leg(size(small)) scheme(s2color) blabel(total, format(%9. 2f)) bargap(5)
3. problem: regardless of the choice of option, how can I customize the percentages so that they are easier to read.
thanks for your help.
Comment