4

In a long but not complex analysis, I am generating a lot of ggplot2 plots, which are being dealt in the same programmatic way.

I will also need matrix plots every now and then, but ggplot2 no longer implements any matrix plot function (since plotmatrix is deprecated).

Like suggested here, GGally's ggpairs() implements matrix plot nicely.

The down side is that ggpairs() returns a ggplot2 object matrix instead of a single ggplot2 object, so I can no longer deal with it in the same fashion I was dealing until then.

Hence my question. Is there a way to convert ggpairs()' return into a single ggplot2 object?

Many thanks in advance!

Marcelo Ventura
  • 581
  • 7
  • 19
  • 2
    No, there's not. (Well, you could save it as an image, and plot that image on a new ggplot, but I guess that's not what you're looking for.) – Gregor Thomas Nov 25 '15 at 21:53
  • 1
    If what you're looking for is a way to put a bunch of `ggplots` together then [this question](http://stackoverflow.com/q/9490482/903061) along with [it's marked duplicate](http://stackoverflow.com/q/7993722/903061) present quite a few options. – Gregor Thomas Nov 25 '15 at 22:01
  • Thanks for the suggestions, @Gregor! I will read them. – Marcelo Ventura Nov 26 '15 at 01:11
  • 1
    See [this answer](https://stackoverflow.com/a/47731111/1870254) – jan-glx Mar 25 '19 at 20:25
  • Does this answer your question? [Create a matrix of scatterplots (pairs() equivalent) in ggplot2](https://stackoverflow.com/questions/3735286/create-a-matrix-of-scatterplots-pairs-equivalent-in-ggplot2) – tjebo Jun 23 '20 at 08:23

0 Answers0