trinitysara
trinitysara

Reputation: 185

How do I move axis labels closer together in Stata graph?

I'm creating an rcap graph in Stata and running into issues with the x-axis labels. No matter what I try, the labels fall outside the graph.

I want to push the labels (and the CI bars) closer together - in other words, I want to narrow the gaps between CI bars (and their associated labels) so that nothing gets cut out.

Here is the graph: enter image description here

And here is my code:

set scheme cleanplots
twoway rcap medicaid_lo medicaid_hi status, xlabel(1 2 3, valuelabel noticks) ytitle("") xtitle("")

Thanks in advance!

Upvotes: 0

Views: 1748

Answers (1)

Bicep
Bicep

Reputation: 1103

set scheme cleanplots

input high low status
0.06 0.02 1
0.28 0.22 2
0.21 0.17 3
end

label define status 1"R" 2"NR" 3"Admin data"
label value status status

twoway rcap high low status, xlabel(1 2 3, valuelabel noticks) ytitle("") xtitle("") xscale(range(0.5 3.5))

enter image description here

You can also try using graphregion(margin(vlarge)), which increases the margins around your graph to allow for space for longer x-axis labels.

Upvotes: 2

Related Questions