水平轴标记导致 y 轴上的白色 space

Horizontal axis labelling causes white space on y axis

这是我的数据:

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-axis 和 y-axis 之间得到一个很大的 space 标题:

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

我已经使用这个方案很多年了,我从来没有遇到过这种问题。

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

anglestyle vertical_tick horizontal 

这看起来很奇怪,因为刻度标签很短,即创建的 space 并不是真正需要的。

我如何调整方案以强制轴标题更靠近轴同时保持水平标记?

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

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

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))