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
How to predict constant from fixed-effect model?Hi, Statalist: I have a coding problem regarding predicting constant from the fixed-effect regress…
Initial Values Problem with melogit and xtmelogitHello, I am fitting an HLM model using a complex survey (DHS) data . My data does not have Level 2 w…
Graph modification: How to modify a line to a "bracket-line", change text to italic and insert character ?Attempting to modify the following graph- 3 questions: 1) Would like to change some of graph text t…
Equation has been stored but it is not found to perform testCould anyone explain to me how to solve this issue? I have run a regression and stored it but I can…
How can I select more than one minimum for each respondentHello Statalist. I have a dataset that looks like this: pid value number 1 0.12 2 1 0.4 2 …
Subscribe to:
Post Comments (Atom)
0 Response to Struggling with hbar
Post a Comment