Questions tagged [gridextra]

`gridExtra` is a package providing convenience functions and extensions on top of `grid`, a low-level framework for R graphics. This facilitates the arrangement of multiple ggplot objects on a single plot.

Description

gridExtra is an R package based on grid graphics, providing a few high-level functions to draw custom graphical objects and organise them on a page.

Additional Resources

  1. Official CRAN documentation.
  2. Info provided by RDocumentation can be found here.
  3. The official guide, written by the package's creator, can be found here.
500 questions
0
votes
2 answers

Unable to pass textGrob as main to do.call("arrangeGrob")

While test <- do.call("arrangeGrob", c(plots.list[1:2],ncol=2,main=("test")) works just fine, test <- do.call("arrangeGrob", c(plots.list[1:2],ncol=2,main=textGrob("test"))) gives the following error: "Error in arrangeGrob(list(grobs =…
Hengrui Jiang
  • 769
  • 1
  • 8
  • 21
0
votes
2 answers

Using grid.arrange with multiple plots

I am plotting several ggparcoord (from GGally package) subplots into one large plot. In general, all but one of the subplots derive from the same data set (x), and the last one comes from a different data set (y). I want each subplot to be a…
user4148072
0
votes
1 answer

Arrange multiple ggplots with same plot width but different plot height

I try to arrange two ggplots with different plot heights but same plot widths using the gridExtra package. I have a solution for either the same width or the same height but I am unable to achieve both. Here is my…
David
  • 6,808
  • 4
  • 32
  • 55
0
votes
1 answer

R, mapply , ggplot : EXPR must be a length 1 vector

I am trying plot the subsets of a table using ggplot and gridExtra. But I have bumbed in the following error EXPR must be a length 1 vector. I could come up with any side step. Any help would be useful. Here is a little example of what I'm trying…
DJJ
  • 2,281
  • 2
  • 24
  • 50
0
votes
0 answers

Add a grid.table plot to a graphics plot

I would like to add a grid to a subplot. I am using graphics (and not ggplot2) Say I have a 2x2 plot and I want to plot the grid in c(1,2) plot: library(gridExtra) …
statquant
  • 12,389
  • 13
  • 75
  • 148
0
votes
1 answer

Grid arrange in ggplot2 and fix ylabs for variable name

I'm plotting all variables using ggplot2, with y-axis labels being the variable name. Then I'm arranging ggplot plots on a grid. The resultant final plot has all the smaller plots having the final plot object getting replicated. Also I would like…
kay dee
  • 43
  • 8
0
votes
1 answer

Output Plot and Table to Same Page for Each Group

I am trying to output a graph and table for each group to one page of a PDF (one page for each group). I am nearly there but I am just having trouble with the final step. I have both a table and a plot on the same page but the table is on top of the…
user3466328
  • 333
  • 1
  • 9
0
votes
1 answer

call a vector of names for grid.arrange

lets say I have a list called ALL with 40 elements, each of which is a ggplot. if i want to plot one of these i can do ALL[[1]] or print(ALL) if i want to plot them all together i can do grid.arrange(ALL[[1]] ,ALL[[2]], ALL[[3]], .... …
user1320502
  • 2,360
  • 4
  • 25
  • 41
0
votes
2 answers

save grobs made in function of loop

I made this long function that ends with a grob figure (3 ggplots). However, when I use this function in a loop and try to put all the resulting grobs into one super figure, I run into problems. I obtain a figure with a lot of grobs, but it's always…
Wave
  • 1,194
  • 1
  • 8
  • 22
0
votes
1 answer

Report writing plots plus table on 1 page

I am hoping to use R to produce a 1 page report that is to be laid out as follows: topleft: plot 1 plot 2 plot 3 plot 4 Topright: plot 5 (4x as big as plots 1:4) Bottomright: Table This page will then be rerun ~100 times so that each page of the…
jc52766
  • 61
  • 4
0
votes
1 answer

Matrix 2X2 and Gridtable formatting&layout

I am really new at this and I hope you could help me. I am trying to represent in a a4 papper (Pageorientation: Landscape) two plots against two tables. In this case I am using the same table (from a .dat file) to simplify the example. I started to…
user3844140
  • 23
  • 1
  • 5
0
votes
1 answer

Grid Arrange Network Maps

I have used the igraph package to draw 11 different network maps. I would like to arrange them in the same page (say 4x3) like what the grid.arrange function does. But the grid.arrange function only works with grob objects. Is there away for me to…
P Mcquiy
  • 185
  • 1
  • 3
  • 10
0
votes
1 answer

Multiple plots with grid.arrange

My data set is a data.frame NewAuto, which has names: [1] "mpg" "cylinders" "displacement" "horsepower" "weight" [6] "acceleration" "year" "origin" "name" "MPG01" I want to make seven plots on one picture…
3dok
  • 103
  • 2
0
votes
1 answer

Combine plots in R

I have several plots that I want to combine them together and add a title to the combined plot, but somehow I cannot combine them using R. (using RStudio) Combine two residual plots plotted by using plot(resid(lme)) where lme is a linear mixed…
TYZ
  • 6,636
  • 4
  • 19
  • 44
0
votes
1 answer

Adjusting distance between plots

I have a couple of ggplot plots that I want to merge using grid.arrange() When I merge the plots there's a large white area around each plot making them far away from each other. Is there a way to adjust the distance between the plots? and the size…
upabove
  • 925
  • 2
  • 14
  • 28
1 2 3
33
34