我想更改matplot
中的标签。我正在绘制的数据是:
> dput(data)
structure(list(`10` = c(0, 0, 0), `34` = c(0, 0, 0), `59` = c(0,
0, 0), `84` = c(0, 0, 0), `110` = c(0, 0, 0), `134` = c(0, 0,
0), `165` = c(0, 0, 0), `199` = c(0, 0, 0), `234` = c(0, 0, 0.2676885
), `257` = c(0, 0.418346309, 0.511770229), `362` = c(1, 1, 1),
`433` = c(0.754546444, 0.56465999, 0.706561864), `506` = c(0,
0, 0.37180538), `581` = c(0, 0, 0.39006135), `652` = c(0,
0, 0.37866372), `733` = c(0, 0, 0.2656878), `818` = c(0,
0, 0.31184348), `896` = c(0, 0, 0.315191776), `972` = c(0,
0, 0.224726092), `1039` = c(0, 0, 0.169250477)), .Names = c("10",
"34", "59", "84", "110", "134", "165", "199", "234", "257", "362",
"433", "506", "581", "652", "733", "818", "896", "972", "1039"
), row.names = c("at3g01510.1", "at5g26570.1", "at1g10760.1"), class = "data.frame")
...但我仍然想保持x
轴的范围相同。列号应更改为列名...
我使用的代码:
matplot(as.matrix(t(data)),type="l",lwd=2,lty=c("solid","48","36"), col=rainbow(length(rowsToPlot)),xlab = 'Fraction Size', ylab = 'Intensity')
legend('topright',c('D', 'B', 'G'),lty=c("48","36"),lwd=2, bty='n', cex=.75, col = rainbow(length(data)))