Graph 水平轴标签导致y轴上出现空白

Graph 水平轴标签导致y轴上出现空白,graph,customization,stata,Graph,Customization,Stata,这是我的数据: input y1 y2 y3 x -0.34834709 -0.02733159 -0.6137266 97 -0.3906476 -0.12309019 -0.68878702 98 -0.43213382 -0.23861568 -0.76169004 99 -0.47270931 -0.28437565 -0.76154058 100 -0.51234194 -0.36507922 -0.81745737 101 -0.55110669 -0.44603292 -0.787

这是我的数据:

input y1 y2 y3 x
-0.34834709 -0.02733159 -0.6137266 97
-0.3906476 -0.12309019 -0.68878702 98
-0.43213382 -0.23861568 -0.76169004 99
-0.47270931 -0.28437565 -0.76154058 100
-0.51234194 -0.36507922 -0.81745737 101
-0.55110669 -0.44603292 -0.78759176 102
-0.58892858 -0.56973828 -0.89383692 103
end
使用标准主题的情节,看起来还不错:

tw connect y1 y2 y3 x, legend(off) ytitle("This is the title of the y axis") scheme(s2mono)
但是,如果使用自定义方案,y轴和y轴标题之间会有很大的空间:

tw connect y1 y2 y3 x, legend(off) ytitle("This is the title of the y axis") scheme(custom)

我已经使用这个计划很多年了,我从来没有遇到过这样的问题

我的
.scheme
文件中的这一行会导致空白(注释掉它):

这似乎很奇怪,因为记号标签很短,即创建的空间实际上并不需要

如何调整方案,使轴标题更靠近轴,同时保持水平标签


顺便说一下,我无法用一些
sysuse
数据重现此行为,这就是我提供实际数据的原因。

此问题与指定的方案(自定义或非自定义)无关。这是一个输出
格式
问题。使用您的玩具示例:

clear
input y1 y2 y3 x
-0.34834709 -0.02733159 -0.6137266 97
-0.3906476 -0.12309019 -0.68878702 98
-0.43213382 -0.23861568 -0.76169004 99
-0.47270931 -0.28437565 -0.76154058 100
-0.51234194 -0.36507922 -0.81745737 101
-0.55110669 -0.44603292 -0.78759176 102
-0.58892858 -0.56973828 -0.89383692 103
end

tw connect y1 y2 y3 x, legend(off) ytitle("This is the title of the y axis") ///
ylabel(, angle(horizontal))

如果指定所需的输出格式,问题就会消失:

tw connect y1 y2 y3 x, legend(off) ytitle("This is the title of the y axis") ///
ylabel(,angle(horizontal) format(%3.1f))

tw connect y1 y2 y3 x, legend(off) ytitle("This is the title of the y axis") ///
ylabel(,angle(horizontal) format(%3.1f))