0

I created a battleship plot using Plotrix:

k<-battleship.plot(data, main="Distribution",xlab="Type",ylab="Phase", 
                                                        maxxspan=0.6,maxyspan=0.45)

j<-battleship.plot(data2, main="Distribution",xlab="Type",ylab="Phase", 
                                                        maxxspan=0.6,maxyspan=0.45)

I want to print both plots together using gridExtra:

library(gridExtra)
grid.arrange(j, k, ncol=1, nrow =2, top=("Types by Phase"))

I get the following error:

Error in gList(list(mar = c(2, 5, 5, 1), wrapvp = list(x = 0.5, y = 0.5,  : 
  only 'grobs' allowed in "gList"

I have tried arrangeGrob without success.

How can overcome this problem? ggplot2 plots are working great, even with the same data.

Sotos
  • 51,121
  • 6
  • 32
  • 66
  • `battleship.plot` is not a grid plot - it is base R. So arrange with `par(mfrow(...))` – user20650 Apr 24 '16 at 14:07
  • However, if you are wanting to arrange, say plots using ggplot, and these, you can convert the plot to a grob using http://stackoverflow.com/questions/27929452/r-return-corrplot-as-object/27948707#27948707 – user20650 Apr 24 '16 at 14:12
  • look at `j` and `k`: they're not grobs but lists of parameters (`mar`) for base graphics – baptiste Apr 25 '16 at 21:38

0 Answers0