我有以下情节
xleft<-c(1,2,3)
xright<-c(2,3,4)
ybottom<-c(1,2,3)
ytop<-c(2,3,4)
plot(c(1,4),c(1,4),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")
x.label<-c("Long species Name4","Long species Name5","Long species Name5")
我想保留数字轴和轴标题。我还想添加一个图例。所以最终产品看起来像这样
无需完全使用清除轴的最佳方法是什么
par(xaxt = "n", yaxt = "n")
并添加文字?谢谢你的建议。