I am trying to display a graph that contains two bar graphs and two scatter plots. I have attached the code below:
*White Hispanics and Non-Hispanic Whites
graph twoway (bar inc_ME year if (race == 100 & hispan != 0 & hispan != 901 & ///
hispan != 902), yaxis(2) ytitle("Margin of Error", axis(2))) ///
(bar inc_ME year if (race == 100 & (hispan == 0|hispan == 901| hispan == 902)), ///
yaxis(1) ytitle("Margin of Error", axis(1))) ///
(scatter inc_mean year if (race == 100 & hispan != 0 & hispan != 901 & hispan ///
!= 902), yaxis(1) ytitle("Mean of Income") msymbol(O)) ///
(scatter inc_mean year if (race == 100 & (hispan == 0|hispan == 901| ///
hispan == 902)), yaxis(1) ytitle("Mean of Income") msymbol(O)), ///
title("Income Margin of Error and Mean") ///
xtitle("X Axis") ///
legend(order(1 "MOE White-Hispanics" 2 "MOE White Only" ///
3 "Mean Income White-Hispanics" 4 "Mean Income White"))
My problem is that when this is run the bar graphs are stacked on top of each other instead of next to each other so they are both visible. How can I fix this?
*White Hispanics and Non-Hispanic Whites
graph twoway (bar inc_ME year if (race == 100 & hispan != 0 & hispan != 901 & ///
hispan != 902), yaxis(2) ytitle("Margin of Error", axis(2))) ///
(bar inc_ME year if (race == 100 & (hispan == 0|hispan == 901| hispan == 902)), ///
yaxis(1) ytitle("Margin of Error", axis(1))) ///
(scatter inc_mean year if (race == 100 & hispan != 0 & hispan != 901 & hispan ///
!= 902), yaxis(1) ytitle("Mean of Income") msymbol(O)) ///
(scatter inc_mean year if (race == 100 & (hispan == 0|hispan == 901| ///
hispan == 902)), yaxis(1) ytitle("Mean of Income") msymbol(O)), ///
title("Income Margin of Error and Mean") ///
xtitle("X Axis") ///
legend(order(1 "MOE White-Hispanics" 2 "MOE White Only" ///
3 "Mean Income White-Hispanics" 4 "Mean Income White"))
My problem is that when this is run the bar graphs are stacked on top of each other instead of next to each other so they are both visible. How can I fix this?
Comment