謝謝你的回答! 對不起! 你的例子看起來類似於我想要的!
的顏色是: colfunc < - colorRampPalette(C( 「darkblue」, 「lightblue」)) colfunc(12)
2007:12條輪廓線(運行通過累積葉橫型材) 甲樣品:
dput(頭(Profile07_6)) 結構(列表(X12 = C(427.89,427.89,427.93,427.96,427.98, 428),X11 = C(421.36,421.34,421.32,421.28, 421.22,421.18), X10 = c(415.81,415.6,415.44,415 ,X8 = c(380.04,379.85, 379.64,379.38,379.15,378.96),X7 = c(358.95,p = 0.0001),X9 = c(401.35, 401.23,401.11,400.94,400.78,400.7) 359.13,359.34, 359.56,359.78,359.99),X6 = c(348.31,348.52,348.68,348.83, 348.96,349.11)),.names = c(「X12」,「X11」,「X10」,「X9 」, 「X8」, 「X7」, 「X6」),row.names = C(NA,6L)中,class = 「data.frame」)
的時候,圖形看起來像這樣
par(tcl=0.5)
matplot(Profile07_6, type = "l", lty = 1, col = colfunc(7), ylim=c(290,440),
ylab = "m asl", xlab="Distance along crossprofile [m]", main ="2007")
par(tcl=0.5)
minor.tick(ny=5, nx=2, tick.ratio=0.5)
abline(h=350, lty=3, col="grey33")
abline(h=400, lty=3, col="grey33")
abline(h=300, lty=3, col="grey33")
abline(h=290, lty=3, col="grey")
abline(h=310, lty=3, col="grey")
abline(h=320, lty=3, col="grey")
abline(h=330, lty=3, col="grey")
abline(h=340, lty=3, col="grey")
abline(h=360, lty=3, col="grey")
abline(h=370, lty=3, col="grey")
abline(h=380, lty=3, col="grey")
abline(h=390, lty=3, col="grey")
abline(h=410, lty=3, col="grey")
abline(h=420, lty=3, col="grey")
abline(h=430, lty=3, col="grey")
abline(h=440, lty=3, col="grey")
axis(4, at=c(290, 310, 320, 330, 340, 360, 370, 380, 390, 410, 420, 430, 440),
labels=c(290, 310, 320, 330, 340, 360, 370, 380, 390, 410, 420, 430, 440),
col.axis="grey33", las=0, cex.axis=0.7, tck=0.01, col = "grey33", padj = -2.1)
對不起,'Comment'我回答... – user3216322
@ user3216322對不起,但那個「答案」沒有提供很多信息。我無法運行你的代碼,因爲我沒有'Profile07_6'。請確保您的代碼可以在* new * R會話中無誤地運行。據我所知,你也可以用'grid()'來代替所有'abline'。 –
@ user3216322我編輯了我的帖子。那是你要的嗎? –