在Stata图中,如何将轴标签更近地移动?

发布于 2025-02-13 20:30:05 字数 477 浏览 5 评论 0原文

我正在Stata中创建RCAP图形,并遇到了X轴标签的问题。无论我尝试什么,标签都落在图表之外。

我想将标签(和CI棒)靠近 - 换句话说,我想缩小CI棒(及其相关标签)之间的差距,以便什么都不会被切断。

这是图:

这是我的代码:

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

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧城烟雨 2025-02-20 20:30:05
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))

您也可以尝试使用GraphRegion(Margin(Vlarge)),它增加了图形周围的边距,以便为更长的X轴标签提供空间。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文