【发布时间】:2012-08-25 21:02:34
【问题描述】:
我有以下情节:
xleft<-c(1,2,2.5)
xright<-c(2,2.5,2.75)
ybottom<-c(1,2,2.5)
ytop<-c(2,2.5,2.75)
par(mar = c(15,15,2.75,2.75) + 0.1)
plot(c(1,2.75),c(1,2.75),type="n",main="title",xlab="site.x",ylab="ylab")
rect(xleft,ybottom,xright,ytop,col=c("blue","red","green"))
#Label position along axes
x.label.position<-(xleft+xright)/2
y.label.position<-(ybottom+ytop)/2
#Labels
x.label<-c("Long species Name1","Long species Name2","Long species Name3")
y.label<-c("Long species Name4","Long species Name5","Long species Name5")
text(par()$usr[1]-0.5,y.label.position,y.label,xpd=TRUE,adj=1)
text(y=par()$usr[3]-0.5,x=x.label.position,x.label,xpd=TRUE,adj=1,srt=90)
par(xpd=TRUE)
legend(-0.1,0,legend=c("Species A","Species B","Species C"),fill=c("blue", "red", "green"))
实际上看起来更像这样:
有没有办法将文本标签缩放到它们所代表的正方形的宽度?感谢您的想法。
【问题讨论】:
-
所以文字和盒子一样薄?何苦?它们会很小,就像它们重叠时一样难以阅读......
-
我同意@Spacedman,最好只是调整文本使其不重叠。
-
哦,珊瑚,我失散多年的爱人!可以看到你的最终作品吗?
-
如果您愿意阅读我的论文,我们非常欢迎您……尽管我怀疑您所指的不是这个。我确实想发布此图形样式将用于显示的数据,以便在发布时向您发送 pdf :) 感谢您的关注。