Hi, I am trying to improve the following graph. Specifically, I would like to put the labels on the axis instead of numbers, but I cant find a way. Note I am just using the temp_canton to order the bars, which surely can be done in a proper way too.
Thank you very much
twoway (bar mean_raw_X temp_canton if temp_canton==1, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==2, horizontal fcolor(dkgreen) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==3, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==4, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==5, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==6, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==7, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==8, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==9, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==10, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==11, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==12, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==13, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==14, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==15, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==16, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==17, horizontal fcolor(dkgreen) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==18, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==19, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==20, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==21, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==22, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==23, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==24, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==25, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==26, horizontal fcolor(navy) legend(off)) ///
(rcap hi_raw_X lo_raw_X temp_canton, horizontal) ///
(scatter temp_canton mean_raw_X, msymbol(none) mlabel(canton) mlabposition(1))
This is the dataset:
Thank you very much
twoway (bar mean_raw_X temp_canton if temp_canton==1, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==2, horizontal fcolor(dkgreen) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==3, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==4, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==5, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==6, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==7, horizontal fcolor(maroon) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==8, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==9, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==10, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==11, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==12, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==13, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==14, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==15, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==16, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==17, horizontal fcolor(dkgreen) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==18, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==19, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==20, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==21, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==22, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==23, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==24, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==25, horizontal fcolor(navy) legend(off)) ///
(bar mean_raw_X temp_canton if temp_canton==26, horizontal fcolor(navy) legend(off)) ///
(rcap hi_raw_X lo_raw_X temp_canton, horizontal) ///
(scatter temp_canton mean_raw_X, msymbol(none) mlabel(canton) mlabposition(1))
This is the dataset:
canton | mean_raw_X | hi_raw_X | lo_raw_X | temp_canton |
JU Jura | 4.934579 | 5.114114 | 4.755045 | 1 |
TI Ticino | 5.619071 | 5.678478 | 5.559665 | 2 |
NE Neuchatel | 5.728467 | 5.780889 | 5.676044 | 3 |
GE Geneva | 5.732616 | 5.790908 | 5.674325 | 4 |
VD Vaud | 5.771214 | 5.807302 | 5.735126 | 5 |
VS Valais | 5.905141 | 5.961002 | 5.849281 | 6 |
FR Fribourg | 5.96763 | 6.024003 | 5.911258 | 7 |
TG Thurgovia | 6.174515 | 6.238292 | 6.110738 | 8 |
SO Solothurn | 6.186933 | 6.238211 | 6.135654 | 9 |
SH Schaffhausen | 6.245283 | 6.353175 | 6.137391 | 10 |
ZG Zug | 6.269742 | 6.357928 | 6.181557 | 11 |
UR Uri | 6.29235 | 6.458621 | 6.126079 | 12 |
BS Basle-Town | 6.297029 | 6.384856 | 6.209203 | 13 |
SG St. Gall | 6.30759 | 6.349748 | 6.265431 | 14 |
BL Basle-Country | 6.335317 | 6.385091 | 6.285542 | 15 |
GL Glarus | 6.365231 | 6.50824 | 6.222222 | 16 |
GR Grisons | 6.376017 | 6.439077 | 6.312957 | 17 |
BE Berne | 6.386811 | 6.413481 | 6.360142 | 18 |
AG Argovia | 6.443415 | 6.476026 | 6.410804 | 19 |
SZ Schwyz | 6.447567 | 6.515052 | 6.380081 | 20 |
ZH Zurich | 6.48209 | 6.505616 | 6.458565 | 21 |
LU Lucerne | 6.499676 | 6.538615 | 6.460737 | 22 |
AR Appenzell Outer-Rhodes | 6.522981 | 6.643445 | 6.402518 | 23 |
OW Obwalden | 6.547884 | 6.679071 | 6.416697 | 24 |
NW Nidwalden | 6.835106 | 6.966758 | 6.703455 | 25 |
AI Appenzell Inner-Rhodes | 6.841177 | 7.039129 | 6.643224 | 26 |
Comment