旋转散点图3d中的y轴标签(调整为轴角度) [英] Rotate y-axis label in scatterplot3d (adjust to angle of axis)

查看:212
本文介绍了旋转散点图3d中的y轴标签(调整为轴角度)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 scatterplot3d 来绘制带有R的3D。y轴标签的方向困扰我,因为它是垂直的并且不平行于y轴。
是否可以旋转标签并调整其角度?不幸的是,我没有在



使用 scale.y

  set.seed(42)
scatterplot3d(rnorm(20),rnorm(20),rnorm(20),ylab =,scale.y = 2)
text(x = 6.5,y = -1.5, Y轴稍长,srt = 45)


I use scatterplot3d to plot 3D with R. The orientation of the y-axis label bothers me because it is vertical and not parallel to the y-axis. Is there a way to rotate the label and adjust its angle? Unfortunately, I didn't finde anything in the documentation.

解决方案

If you don't have to draw many plots and are willing to adjust values manually, you can pass ylab = "" when making the 3d scatter and then add text later on with appropriate srt value. srt allows you to rotate text at desired angle. Note that x and y when adding text is different from x and y of 3d scatter.

set.seed(42)
scatterplot3d(rnorm(20), rnorm(20), rnorm(20), ylab = "")
text(x = 5, y = -2.5, "Y-axis", srt = 45)

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

这篇关于旋转散点图3d中的y轴标签(调整为轴角度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆