R scatterplot3d 转x轴文字45°
R scatterplot3d turn x axis text 45°
我有这样的东西,想将 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="")
您可以执行以下操作:
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)
而且有效!
我有这样的东西,想将 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="")
您可以执行以下操作:
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)
而且有效!