在 scatterplot3d 中旋转 y 轴标签(调整为轴的角度)
Rotate y-axis label in scatterplot3d (adjust to angle of axis)
我使用 scatterplot3d
用 R 绘制 3D。y 轴标签的方向让我很困扰,因为它是垂直的而不平行于 y 轴。
有没有办法旋转标签并调整其角度?不幸的是,我没有在 documentation.
中找到任何内容
如果你不需要绘制很多图并且愿意手动调整值,你可以在制作3d散点时传递ylab = ""
,然后在稍后添加text
适当的srt
值。 srt
允许您以所需角度旋转文本。请注意,添加文本时的 x
和 y
不同于 3d 散点的 x
和 y
。
set.seed(42)
scatterplot3d(rnorm(20), rnorm(20), rnorm(20), ylab = "")
text(x = 5, y = -2.5, "Y-axis", srt = 45)
使用scale.y
set.seed(42)
scatterplot3d(rnorm(20), rnorm(20), rnorm(20), ylab = "", scale.y = 2)
text(x = 6.5, y = -1.5, "Somewhat longer Y-axis", srt = 45)
我使用 scatterplot3d
用 R 绘制 3D。y 轴标签的方向让我很困扰,因为它是垂直的而不平行于 y 轴。
有没有办法旋转标签并调整其角度?不幸的是,我没有在 documentation.
如果你不需要绘制很多图并且愿意手动调整值,你可以在制作3d散点时传递ylab = ""
,然后在稍后添加text
适当的srt
值。 srt
允许您以所需角度旋转文本。请注意,添加文本时的 x
和 y
不同于 3d 散点的 x
和 y
。
set.seed(42)
scatterplot3d(rnorm(20), rnorm(20), rnorm(20), ylab = "")
text(x = 5, y = -2.5, "Y-axis", srt = 45)
使用scale.y
set.seed(42)
scatterplot3d(rnorm(20), rnorm(20), rnorm(20), ylab = "", scale.y = 2)
text(x = 6.5, y = -1.5, "Somewhat longer Y-axis", srt = 45)