I've been working to finalize my code for a figure, and I'm struggling to be able to see the entirety of my label on the "x" axis when using the hbar command.
When I graph as a bar plot (see file bar.jpg), everything shows up as required in the label.
Array
Here's my code:
splitvallabels question
graph bar Likert1 Likert2 Likert3 Likert4 Likert5, percentage stack over(question,label(labsize(vsmall)) relabel(`r(relabel)')) ytitle("Percent Dstribution of Likert Scores", size(vsmall)) ylabel(0(20)100,labsize(small)) bar(1, color(black) lcolor(black) lwidth(vthin)) bar(2, color(cranberry) lcolor(black) lwidth(vthin)) bar(3, color(teal) lcolor(black) lwidth(vthin)) bar(4, color(gs14) lcolor(black) lwidth(vthin)) bar(5, color(stone) lcolor(black) lwidth(vthin)) blabel(bar, size(tiny) format(%4.0f) position(center)) intensity(50) legend(size(vsmall) position(5) keygap(1) symxsize(2) label (1 "Much Less Willing") label (2 "Less Willing") label (3 "No change") label (4 "More Willing") label (5 "Much More Willing")) title("Physician Willingness to Discontinue Hourly Neuroassessments", span size (medsmall))
However, if I try to make it a horizontal bar graph (which is my preference), the left side of the figure gets truncated and I can't even read the labels (see file hbar.jpg).
Array
The code is exactly the same except for the "graph hbar".
splitvallabels question
graph hbar Likert1 Likert2 Likert3 Likert4 Likert5, percentage stack over(question,label(labsize(vsmall)) relabel(`r(relabel)')) ytitle("Percent Dstribution of Likert Scores", size(vsmall)) ylabel(0(20)100,labsize(small)) bar(1, color(black) lcolor(black) lwidth(vthin)) bar(2, color(cranberry) lcolor(black) lwidth(vthin)) bar(3, color(teal) lcolor(black) lwidth(vthin)) bar(4, color(gs14) lcolor(black) lwidth(vthin)) bar(5, color(stone) lcolor(black) lwidth(vthin)) blabel(bar, size(tiny) format(%4.0f) position(center)) intensity(50) legend(size(vsmall) position(5) keygap(1) symxsize(2) label (1 "Much Less Willing") label (2 "Less Willing") label (3 "No change") label (4 "More Willing") label (5 "Much More Willing")) title("Physician Willingness to Discontinue Hourly Neuroassessments", span size (medsmall))
It's taken me a lot of time to even get this far, and I've tried to figure it out on my own, but I've been unsuccessful. I suspect this is a simple fix, and any help is appreciated!
Related Posts with Struggling with hbar
Query about using aweight while running probit in STATADear all, I am a PhD student at the University of Canterbury, NZ. I wanted to use aweight while run…
Blue-gray thin frame when combining graphsHi Everyone, I want to combine two graphs using 'gr combine' command. Each individual graph looks a…
How to use the variance of a variableThis may be a noob question. I have been given individual-level data on 10000 person. I have variab…
Python Integration: Pandas Package Causing Stata to CloseAfter setting my python_userpath and python_exec, attempting to execute the following lines from a d…
Using esttab to create a tableHi, I am trying to create a table (example attached) using esttab command. I have run different spe…
Subscribe to:
Post Comments (Atom)
0 Response to Struggling with hbar
Post a Comment