问题描述
Date Period Input Streamflow
1 1984-01-01 Calibration Observed 4.4176
2 1984-01-02 Calibration Observed 3.4924
3 1984-01-03 Calibration Observed 3.0657
4 1984-01-04 Calibration Observed 2.7506
5 1984-01-05 Calibration Observed 2.5774
6 1984-01-06 Calibration Observed 3.1584
此数据帧具有2个不同的周期和7个输入。我创建了一个按周期和输入除以的facet_grid,如下所示:
p <- ggplot(data = df,aes(x=Date,y=Streamflow,group=Period))+
geom_point(data = filter(df,Input == "Observed"),colour="black") +
geom_line(aes(colour=factor(Input)))+
facet_grid(Input ~ Period,scales = "free_x") +
coord_cartesian(expand = FALSE)
p
我想创建12个子图(6行2列),包括6个输入(来自7个)。我想在所有子图中重复最后输入(“观察到”)。但是,当我创建代码时,它创建了一个新的绘图,如下图所示:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)