Multiple ggplots on one page using a for loop and grid.arrange

后端 未结 1 1226
别那么骄傲
别那么骄傲 2021-01-24 02:08

I am trying to plot multiple variable correlation plots on one page - but the points aren\'t being plotted correctly when I use a for loop. They are fine if I create each plot i

相关标签:
1条回答
  • 2021-01-24 02:54

    I encountered similar problem. Here's my solution: change the mapping parameter to aes_string() in funtion ggplot

      plot_list[[i]] <- ggplot(data=master, aes_string(get(x), get(y))) + geom_point() + geom_abline(slope=slope, intercept=intercept)
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题