Dear Statalists,
apologies in advance if this question has an easy answer/or was asked before:
I intend to create a bar graph with 4 variables of which I want 2 of them stacked on to each other. So far the codes I have used are:
graph bar (sum) new_deep shallow_to_deep new_shallow shallow_reverse, over(y)
(see also attachment Graph_1)
and then I have been trying to create a "group" for the stacking:
gen exp=0
replace exp=1 if new_deep==1
replace exp=1 if shallow_to_deep==1
to graph:
graph bar (sum) new_deep shallow_to_deep new_shallow shallow_reverse, over(y) stack over (exp)
(see also attachment Graph_2)
However this result is also not quite want I want, as in the second graph the stacking is correct, but I want both bars side by side and one unified x-axis from 1997-2014 (just as in the first graph).
Could anyone point me into the right direction of how to achieve this??
Thanks a lot!!
apologies in advance if this question has an easy answer/or was asked before:
I intend to create a bar graph with 4 variables of which I want 2 of them stacked on to each other. So far the codes I have used are:
graph bar (sum) new_deep shallow_to_deep new_shallow shallow_reverse, over(y)
(see also attachment Graph_1)
and then I have been trying to create a "group" for the stacking:
gen exp=0
replace exp=1 if new_deep==1
replace exp=1 if shallow_to_deep==1
to graph:
graph bar (sum) new_deep shallow_to_deep new_shallow shallow_reverse, over(y) stack over (exp)
(see also attachment Graph_2)
However this result is also not quite want I want, as in the second graph the stacking is correct, but I want both bars side by side and one unified x-axis from 1997-2014 (just as in the first graph).
Could anyone point me into the right direction of how to achieve this??
Thanks a lot!!
Comment