Paul Emberson
2008-Aug-14 13:31 UTC
[R] ggplot2: remove minor-horizontal guide before drawing
Hi, I want to remove minor-horizontal and minor-vertical lines from a plot generated with ggplot2. I can do this after the plot has been drawn using grid.gremove. However, I would like to do it before drawing my plot. The ggplot2 book refers to a ggplotGrob function which creates a grob from a plot but this function doesn't seem to exist in ggplot2 0.6. Is there another way to do it? Regards, Paul
hadley wickham
2008-Aug-14 15:00 UTC
[R] ggplot2: remove minor-horizontal guide before drawing
Hi Paul, Unfortunately, the book is a bit ahead of the current version of ggplot2 code, and it's a bit of pain to do in the 0.6 code. Your best bet is to have a look at grid.grab to capture the grob before it is drawn. In the development version the new theming support lets completely turn off minor gridlines (or pretty much anything else) for a whole session, which should make things easier in the future. Hadley On Thu, Aug 14, 2008 at 8:31 AM, Paul Emberson <email at calidasoft.co.uk> wrote:> Hi, > > I want to remove minor-horizontal and minor-vertical lines from a plot > generated with ggplot2. I can do this after the plot has been drawn using > grid.gremove. > > However, I would like to do it before drawing my plot. The ggplot2 book > refers to a ggplotGrob function which creates a grob from a plot but this > function doesn't seem to exist in ggplot2 0.6. > > Is there another way to do it? > > Regards, > > Paul > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- http://had.co.nz/