Create something like your list:
Turbine = lapply(1:5,data.frame(TS=1:10,"Pv..turbine"=runif(10))
You can use the plotlist=
argument in plot_grid, note, you don't need par(mfrow=..)), thats meant for base R plots and also you don't need to use the $
inside aes
:
library(cowplot)
library(ggplot2)
myplots=list()
for (i in 1:5) {
myplots[[i]] = ggplot(Turbine[[i]],
aes(x=TS,y=Pv..turbine))+
geom_point(size=1)
}
plot_grid(plotlist=myplots,ncol=5)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…