0

我已经成功生成了一个代码,可以从多个简单的 csv 文件(以米为单位的增益与以公里为单位的距离)在一个图中绘制高程数据

这是我的代码:

plot(wash,type="l",xlim=c(0,13.5),ylim=c(0,1500),col=554,lwd = 3)
lines(grade,lwd = 1,lty=3)
lines(megan,lwd = 3,col="3")
lines(godin,lwd = 3,col="deepskyblue")
lines(whiteface,lwd = 3,col="118")
lines(angliru,lwd = 3,col="navy")
grid(col = "grey", lty = "dotted", lwd = 1)
legend("topleft",bty = "o", bg = "white",c("Mt Washington","Mt Mégantic","Côte à Godin","Whiteface","Alto del Angliru"),col = c("554","3","deepskyblue","118","yellow3","navy"),cex=0.9,lwd = 2,inset = c(0.05, 0.05),lty = c(1,1,1,1,1,1,1))
title("Montées", cex.main = 0.9)
legend("bottomright",bty = "o", bg = "white",c("Pente 10%"),cex=0.9,lwd = 1,lty = 3,inset = c(0.03, 0.03))

这工作正常,但后来我只想绘制一个 csv 文件:

plot(whiteface,type="l",xlim=c(0,13.5),ylim=c(0,1500),col=554,lwd = 3)
lines(grade,lwd = 1,lty=3)
title("Whiteface", cex.main = 0.9)

除了一个(whiteface.csv)之外的每个csv文件都可以正常工作,我得到了这个错误:

plot(whiteface,type="l",xlim=c(0,13.5),ylim=c(0,1500),col=554,lwd = 3)
lines(grade,lwd = 1,lty=3)
Error in plot.default(...) : 
  formal argument "type" matched by multiple actual arguments
title("Whiteface", cex.main = 0.9)
Error in title("Whiteface", cex.main = 0.9) : 
  plot.new has not been called yet

csv 文件似乎与其他文件没有什么不同,当我绘制包括 whiteface 在内的多个文件时,它也可以正常工作。

4

0 回答 0