【问题标题】:R scatterplot3d turn x axis text 45°R scatterplot3d 将 x 轴文本旋转 45°
【发布时间】:2015-05-24 19:31:04
【问题描述】:

我有这样的东西,想将 xlabels 转 45 度(这将是相当长的文本):

a<-c(1:10)
b<-c(1:10)
c<-c(1:10)
  scatterplot3d(a,b,c,
                main="3-D Scatterplot",color="blue", pch=19,
                type="h", lty.hplot=2, box=F,
            scale.y=.5, 
            lty.grid=1,
            lab=c(9,5,1),
            xlab="",
            ylab="",
            zlab="")

【问题讨论】:

  • 你的试验到目前为止?我们不为您做这项工作,请通过您的尝试、您没有带来解决方案的研究结果等来改进问题

标签: r text 3d axis scatter-plot


【解决方案1】:

您可以执行以下操作:

library(scatterplot3d)
a<-c(1:10)
b<-c(1:10)
c<-c(1:10)
#remove x labels using x.ticklabs = ''
scatterplot3d(a,b,c,
              main="3-D Scatterplot",color="blue", pch=19,
              type="h", lty.hplot=2, box=F,
              scale.y=.5, 
              lty.grid=1,
              lab=c(9,5,1),
              xlab="",
              ylab="",
              zlab="", x.ticklabs='')
#add the labels using the text function. srt specifies the angle.
text(x=b, y=1, pos=1, labels=b, srt=45, adj=1, xpd=TRUE, offset=0.5)

而且它有效!

【讨论】:

  • 效果很好。也许对其他人有用:当我使用来自 poLCA 的数据时,必须指定 b
  • 太棒了!很高兴我能帮上忙:)
猜你喜欢
  • 2022-01-24
  • 2013-12-13
  • 1970-01-01
  • 2012-06-30
  • 1970-01-01
  • 2017-06-24
  • 1970-01-01
相关资源
最近更新 更多