Hello, I would like to create a bar graph with x-labels that are angled at 45 degrees, where one of the labels is split into two lines of text. Is this possible? When I run the following code, the resulting graph shows labels 1, 3, 4, and 5 at the desired 45 degree angle. Label #2, the label I would like to split into 2 lines of text, is displayed at the default 0 degrees, ruining the graph.
core25.gph
In case it is relevant, I am using Stata 18 and my operating system is Mac (macOS Tahoe 26.5.1). Thank you!
Code:
graph bar coreP1, ///
over(num5, axis(lwidth(medthin) lcolor("217 217 217") lpattern(solid)) ///
gap(60) label(labgap(0.05in) angle(45)) ///
relabel( ///
1 "Administrative" ///
2 `" "Community" "Engagement" "' ///
3 "Research" ///
4 "Data Science" ///
5 "Pilot Projects")) ///
bar(1, fcolor("160 205 209") lcolor("030 137 129%100") lwidth(medium)) ///
ylabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", ///
angle(0) labsize(10pt) labgap(0.06in) notick ///
gmax glwidth(medthin) glcolor("217 217 217") glpattern(solid)) ///
ytitle("") ///
yscale(lstyle(none) range(0 105)) ///
blabel(bar, format(%4.1f) size(10.5pt) box bcolor(white) ///
gap(1.4) margin(0 0 0 0)) ///
graphregion(margin(l-4 b-0)) ///
outergap(5) ///
legend(off)
In case it is relevant, I am using Stata 18 and my operating system is Mac (macOS Tahoe 26.5.1). Thank you!

Comment