使用grid.arrange()在同一页面中绘制多个绘图
我需要安排在同一个pdf页面中使用ggplots stat_binhex生成的4个绘图使用grid.arrange()在同一页面中绘制多个绘图,r,ggplot2,R,Ggplot2,我需要安排在同一个pdf页面中使用ggplots stat_binhex生成的4个绘图 densityplots<-lapply(1:breaks, function(i){ dataplot<-ggplot(data,aes(x=data$A, y=data$B)) + stat_binhex() + xlim(-2,2) + ylim(-2,2) return(dataplot) }) 我发现了错误: Error in data.frame(x = c(-1.34537
densityplots<-lapply(1:breaks, function(i){
dataplot<-ggplot(data,aes(x=data$A, y=data$B)) + stat_binhex() + xlim(-2,2) + ylim(-2,2)
return(dataplot)
})
我发现了错误:
Error in data.frame(x = c(-1.34537238683369e-05, 0.0053077854, 0.0011863784, :
arguments imply differing number of rows: 11508, 9864
用于生成图的数据集A和B的行数不同。如何在同一页上绘制它们
谢谢大家! 不要在aes中使用$。语法是aesx=A,y=B和ggplot,然后在传递给数据参数的data.frame中查找这些变量。谢谢Roland!解决了的!
Error in data.frame(x = c(-1.34537238683369e-05, 0.0053077854, 0.0011863784, :
arguments imply differing number of rows: 11508, 9864