正如 Nick 暗示的那样,提供可重现的示例是帮助 SO 上的其他人帮助您的最佳方式。
不过,使用 roctab 帮助文件中的示例,我们可以看到标准的 Stata 图看起来像这样:
webuse hanley, clear
roctab disease rating, graph
我喜欢使用方案cleanplots(由 Trenton Mize 编写),您可以使用以下命令进行安装:
net install cleanplots, from("https://tdmize.github.io/data/cleanplots")
然后,您可以将其设置为永久方案,或者在调用图表时显式调用它。例如:
* Option 1: set to cleanplots permanently (or until I change to something else)
set scheme cleanplots, perm
* Option 2: set to cleanplots just for this session
set scheme cleanplots
*Option 3: call cleanplots explicitly by adding this option when you call your graph
, scheme(cleanplots)
然后你可以运行 graph 命令,它会给你这样的东西:
roctab disease rating, graph scheme(cleanplots) //i'm assuming you went with Option 3
我个人认为这可以显着清理图表(移除绘图周围的蓝色填充,在 y 轴和 x 轴标题及其对应轴之间添加更多空间,旋转 ylabel 以便它们更易于阅读, ETC。)。然后要获得您想要的其他两个项目(移动图例并删除模糊的网格线),您只需要添加更多选项:
roctab disease rating, graph legend(on ring(1) row(2) pos(2)) ylab(, nogrid) xlab(, nogrid)
请注意,上面删除了水平和垂直网格线,但如果您只想删除水平网格线,只需删除读取 xlab(, nogrid) 的位。如果你想将图例移动到绘图区域(它目前在它之外,see p.3 of this documentation),你应该将ring() 的值从1 更改为0。
最后值得注意的是,每当帮助文件说您可以通过twoway_options 时,roctab 帮助文件可以,您可以使用任何双向选项。我接受这仍然给错误和发现留下了很大的空间,但仍然认为值得一提。