我的代码如下
library(readxl) setwd("c:/Users/15940/Desktop/lw/槲皮素(QUE)") df<-read_excel("槲皮素(普荧、同步、位点).xlsx",range = cell_cols(1:9)) library(tidyr) df_long <- pivot_longer(df, cols = -1, names_to = "浓度", values_to = "吸光值") library(ggplot2) > ggplot(data = df_long, aes(x = '波长', y = '吸光值', color = '浓度')) +
+ geom_line() +
+ labs(title = '槲皮素', x = '波长', y = '吸光值') +
+ theme_minimal()
library(readxl) setwd("c:/Users/15940/Desktop/lw/槲皮素(QUE)") df<-read_excel("槲皮素(普荧、同步、位点).xlsx",range = cell_cols(1:9)) library(tidyr) df_long <- pivot_longer(df, cols = -1, names_to = "浓度", values_to = "吸光值") library(ggplot2) > ggplot(data = df_long, aes(x = '波长', y = '吸光值', color = '浓度')) +
+ geom_line() +
+ labs(title = '槲皮素', x = '波长', y = '吸光值') +
+ theme_minimal()