当我需要在 R 中编写一些代码时,我通常会使用 R Studio。但是一旦我想用图例绘制绘图,我就会切换到 R Gui,因为 RStudio 的图例框是不同的,对我来说不愉快。
\n\n让我用一个例子来解释一下:
\n\nsigma <- (1:7000)/10000\n\nratioMSY <- 1 - 5.26 * sigma^2\nplot(sigma, ratioMSY, type="l", ylab="MSY(sigma^2)/MSY(0)", ylim=c(0,1), \n lty=2, cex.lab=1.5, bty="n", cex.axis=1.5, lwd=3)\n\npar(new=T)\nratioMSY <- 1 - 2.78 * sigma^2\nplot(sigma, ratioMSY, type="l", ylab="MSY(sigma^2)/MSY(0)", ylim=c(0,1), lty=1, \n cex.lab=1.5, bty="n", cex.axis=1.5, lwd=3)\n\npar(new=T)\nratioMSY <- 1 - 1.96 * sigma^2\nplot(sigma, ratioMSY, type="l", ylab="MSY(sigma^2)/MSY(0)", ylim=c(0,1), lty=3, \n cex.lab=1.5, bty="n", cex.axis=1.5, lwd=3)\n\nlegend(0,0.4,c("r = 0.1","r = 0.2","r = 0.3"), lty=c(2,1,3), cex=1.5)\nRun Code Online (Sandbox Code Playgroud)\n\n现在我用 RStudio 和 RGui 来做。
\n\n使用 RStudio: …
r ×1