【发布时间】:2019-11-02 00:31:39
【问题描述】:
好的,所以我在这里得到了一些代码来绘制人口动态图,我希望在曲线的每个“末端”,在 x 和 y 轴上写一个特定的值,如下所示:@ 987654321@
我首先尝试删除轴号,因为我不需要它们,但这里的真正问题是我有大量这些图(有一个循环版本的代码,但我不会在这里展示为了简单起见),我想自动添加这些值。
### Outcome study with isoclines
#Clearing workspace
rm(list=ls())
graphics.off()
#plot setup
#par(mfrow=c(2,2))
#Parameters
lambda1<- 3.2
lambda2<- 3
alphs <- matrix(c(0.005, 0.005, 0.0045, 0.004), ncol = 2, byrow = TRUE)
#Plotting isoclines
plot(0,0,type="l",xlab='N1',ylab='N2',col='blue',xlim =c(0,470),
ylim = c(0,750))
abline(a=((lambda1-1)/alphs[1,2]),b=(- alphs[1,1]/alphs[1,2]),col='blue')
abline(a=((lambda2-1)/alphs[2,2]),b=(- alphs[2,1]/alphs[2,2]),col='green')
legend("topright", legend = c("Species 1", "Species 2"),lty = 1,
col = c("blue", "green"), bty = "n")
arrows(x0 = 300, y0 = 600, x1 = 270, y1 = 600, length = 0.06,col="blue")
arrows(x0 = 300, y0 = 600, x1 = 300, y1 = 510, length = 0.06, col="green")
arrows(x0 = 50, y0 = 100, x1 = 80, y1 = 100, length = 0.06,col="blue")
arrows(x0 = 50, y0 = 100, x1 = 50, y1 = 190, length = 0.06, col="green")
老实说,我不知道会发生什么,但一定有办法做到这一点,对吧?
【问题讨论】:
标签: r plot axis-labels