我有兩個圖,即泰勒圖和 ggplot。我想將它們繪制在一個圖中(并排)。我試過“圖書館(拼湊而成)”,但不幸的是它不起作用。
library(tidyr)
library(openair)
dat=data.frame(
a=runif(10),
b=runif(10)
)
dat = gather(dat, columnNames, values)
colnames(dat)=c("model", "x")
dat$b=runif(20)
plot1= ggplot(dat, aes(x = x, y = b, group = model,
color = model, shape = model))
geom_point( aes(colour = model))
#plot-2
dates <- seq(as.Date("2015-01-01"),as.Date("2015-12-31"),1)
obs=runif(365)
mod=runif(365)
model=rep(c("model1","model2"),times=c(150,215))
mod.dat <- data.frame(dates,obs,mod,model)
TaylorDiagram(mod.dat, obs = "obs", mod = "mod", group = "model")
uj5u.com熱心網友回復:
怎么樣 gridExtra::grid.arrange
library(ggplot2)
library(tidyr)
library(openair)
dat=data.frame(
a=runif(10),
b=runif(10)
)
dat = gather(dat, columnNames, values)
colnames(dat)=c("model", "x")
dat$b=runif(20)
plot1= ggplot(dat, aes(x = x, y = b, group = model,
color = model, shape = model))
geom_point( aes(colour = model))
#plot-2
dates <- seq(as.Date("2015-01-01"),as.Date("2015-12-31"),1)
obs=runif(365)
mod=runif(365)
model=rep(c("model1","model2"),times=c(150,215))
mod.dat <- data.frame(dates,obs,mod,model)
plot2 <- TaylorDiagram(mod.dat, obs = "obs", mod = "mod", group = "model")
gridExtra::grid.arrange(plot1, plot2$plot, ncol = 2)

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/328488.html
下一篇:在指定分位數后添加箱線圖例外值
