Hello everybody.
I use the next code to create bar graph:
And then I repeated it three additional time with three other measures, and I named the graphs g2, g3 and g4.
Then, I wanted to combine all four graphs, to present them together, so I commanded Stata:
The trouble is that the legend appear under every one of the four graphs in the combine figure. As far as I understand, you can't create legend with the command
, so I left legends only in the two lowers graphs in the combined figures, but it still looks a little bit stupid that the same legend appears twice.
Can anybody help me and tell me how can I command Stata to put only one legend under the four combined graphs (and that it will be centered, of curse)
Best,
Fitzgerald
I use the next code to create bar graph:
Code:
twoway /// (bar mean_disqualified x if category_lbl == 1, barwidth(0.25) color(blue) lcolor(black)) /// (bar mean_disqualified x if category_lbl == 2, barwidth(0.25) color(gs12) lcolor(black)) /// (bar mean_disqualified x if category_lbl == 3, barwidth(0.25) color(red) lcolor(black)) /// (rcap lower_ci upper_ci x, lcolor(black)), /// xlabel(1 "Above Median" 2 "Below Median", labsize(small)) /// xscale(range(0.5 2.5)) /// ylabel(, angle(horizontal)) /// xtitle("") /// title("Measure 1", size(medium)) /// legend(order(1 "Upward Ethical Violation" 2 "Unbiased Teacher" 3 "Downward Ethical Violation") /// pos(6) row(1) size(vsmall)) /// name(g1, replace) ///
Then, I wanted to combine all four graphs, to present them together, so I commanded Stata:
Code:
graph combine g1 g2 g3 g4, row(2) title("Figure 2") subtitle("Proportion of Disqualified Exams by Medians of Homogeneity Measures", size(medsmall)) iscale(.8) imargin(2 2 2 2) ycommon /// note("Upward ethical violation represents teachers with a positive difference of 10 points or higher, Downward ethical violation represents teachers with a negative difference of 10 points" /// "or lower, Unbiased teacher represents teachers who are neither upward nor downward ethical violators. 95% confidence intervals presented.", size(vsmall))
Code:
graph combine
Can anybody help me and tell me how can I command Stata to put only one legend under the four combined graphs (and that it will be centered, of curse)
Best,
Fitzgerald
Comment