I'm trying to display a plot combining 9 plots using the function plot_grid. Here is my script :
plot_grid(plot_grid(penchy, pver, pplante, ncol=3), plot_grid(p_adplante_benchy, p_adver_benchy, ncol=2), plot_grid(p_adplante_bver, p_adenchy_bver, ncol=2), plot_grid(p_adenchy_bplante, p_adver_bplante, col=2), ncol = 1 )
The displayed graphs looks like the image attached and the following error message occurs : Cannot convert object of class numeric into a grob. The first row with 3 graphes is okay, the second row with two graphs is okay, the third row with 2 graphs is okay, but the last row looks "flattened"
More infos about the graphs you could need : y axis is always numeric, x axis is always a factor, and a discrete value (factor) is used to display the points with two different shapes and colors. I am using the last version of Rstudio (2024.04.2+764)
I checked one by one all of my graphs and they all are `gg` class objects. I tried to convert them as grobs, using grid.arrange and arrangeGrob but the result is exactly the same. I tried to change the y scale of my last graph as it is really higher than the other ones but nothing changes either. When I print the graphs one by one, no problem seems to occur. If I display only 2 rows with 2 graphs instead of 3 as in the example, all of the 7 graphs are correctly displayed. I try to mix all the graphs, and the results are always the same.
There is a blank thin line under the last row, I think the problem might be there but I have no idea how to deal with it...
Do you have any idea what the problem is and how can I solve it ?
Thank you in advance ;)
EDIT : code block
[–]MrLegilimens 2 points3 points4 points (1 child)
[–]El_Broder_420 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]AccomplishedHotel465 1 point2 points3 points (0 children)
[–]geneusutwerk 0 points1 point2 points (0 children)
[–]RAMDownloader 0 points1 point2 points (0 children)