Can someone help me figure out how can I have a twoway bar plot with different bar gaps, i.e. in the below example I would like to have the first bar and the second bar and the third bar and the forth bar with no gap in between and I would like to have a gap between the second and the third bar.
Array
This is my code:
Code:
twoway (bar mean sample if sample==1, bcolor(maroon) barw(0.85)) (bar mean sample if sample==2, bcolor(navy) barw(0.85) bargap(-100)) (bar mean sample if sample==3, bcolor (maroon) barw(0.85) ) (bar mean sample if sample==4, bcolor (navy) barw(0.85)) (rcap hi_sem low_sem sample if sample==1 | sample==2 | sample==3 | sample==4, lcolor(black)), legend( row(1) order(1 "Left side" 2 "Right side" 3 "Left side" 4 "Right side")) graphregion (color(white)) plotregion(margin(b=0)) xtitle("") xlabel( 1.5 "Starting Left" 3.5 "Starting Right", noticks) ylabel (0(200)1200)
0 Response to Stata Twoway bar plots - different bar gaps
Post a Comment