library(ggplot2) library(cowplot) # This follows directly from the previous bit of code predictions = newDat predictions$ymin = predictions$predictions-1.96*predictions$SE predictions$ymax = predictions$predictions+1.96*predictions$SE #### plots #### predictionsC = predictions[which(predictions$Depth==30),] A1 = ggplot(predictionsC,aes(x=Complexity, y=predictions, ymin = ymin, ymax = ymax))+ geom_line(size=2) + geom_ribbon(alpha=0.15,color=NA) + theme_bw() A1 = A1 + labs(y="Length anomaly",x="Topographic Structural Complexity")+theme(legend.title = element_blank(),text = element_text(size=21))+ scale_y_continuous(limits = c(-1.25, 1.25), breaks=seq(-1,1, 0.5))+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) predictionsD = predictions[which(predictions$Complexity==3),] A2 = ggplot(predictionsD,aes(x=Depth, y=predictions, ymin = ymin, ymax = ymax))+ geom_line(size=2) + geom_ribbon(alpha=0.15,color=NA) + theme_bw() A2 = A2 + labs(y=" ",x="Depth (m)")+theme(legend.title = element_blank(),text = element_text(size=21))+ scale_y_continuous(limits = c(-1.25, 1.25), breaks=seq(-1,1,0.5))+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) temp = plot_grid(A1,A2) jpeg("20200407_PugetSound_TLbyComplex2AndDepth15.jpeg", width = 14, height = 5.5, units = 'in', quality=75, res=600) plot_grid(A1,A2) dev.off() ##