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
Time series regression analysis with multiple desricptorsHi, I need to run a multivariate time series regression with multiple descriptors. Could someone pl…
Matching data in a case controlHello there, I am trying to match data for a case control study on a positive cancer diagnosis on b…
Help deciding on panel modelHi there, I am new to Stata 15 and need help deciding on a regression model for my panel data. I ha…
Specifying Identity Equation for Forecast of ARIMA(0,1,1) With and Without a ConstantI am estimating an arima(0,1,1) and then using the forecast suite but am having difficulty in specif…
Twoway graph of treated/control means by group with smoothingHi all, I am trying to generate some plots using the means for treatment/control group for various g…
Subscribe to:
Post Comments (Atom)
0 Response to Struggling with hbar
Post a Comment