|||
原始数据如上,利用ggplot2绘图需要对数据进行转换,转化为如下形式:
library(ggplot2)
library(tidyr)
plotdata <-read.csv(file = "searef2.csv", header = TRUE)
plotdata2 <- gather(plotdata, key = type, value = ref, 2:90)
ggplot(plotdata2,aes(wavelength, ref, col = type)) + geom_line()+theme(legend.position='none')+
xlab("Wavelength(um)") + theme(axis.title.x =element_text(size = 15))+
ylab("Reflectance") + theme(axis.title.x = element_text(size =15))
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-27 19:55
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社