Skip to content
Prev 163705 / 398506 Next

ggplot2 - suggestion for facet_wrap/grid

2008/12/3 hadley wickham <h.wickham at gmail.com>
I was sure :-)
OK. I thought that facet_wrap was created to "control" the layout of
facet_grid plot with one-side formula, since a facet_grid plot with one-side
formula should be (almost?) identical with a facet_wrap plot with nrow (or
ncol) = 1.

By the way, I've just test this thing to see the diffences between the two
plots :

d <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
   xlim(0, 2) + stat_binhex(na.rm = TRUE) + opts(aspect.ratio = 1) ## from
official documentation
d + facet_grid(~ color)
d + facet_wrap(~ color)
d + facet_wrap(~ color, nrow = 1)
Erreur dans rep(list(nullGrob()), nrow * ncol - length(vec)) :
  argument 'times' incorrect

Is this error normal ? facet_wrap must always give a 2d ribbon of panels ?

Thank you very much for your patience.

david
Message-ID: <979ffa270812030743l5dc430cdjb1b3f94af3f174c8@mail.gmail.com>
In-Reply-To: <979ffa270812030742m372cd9e1v681b226fcf93ce69@mail.gmail.com>