[R] ggplot: Axis lines

Pedro de Barros pbarros at ualg.pt
Tue Apr 8 11:07:36 CEST 2008


Hi Hadley,

Thanks. I did this already, indeed, but the issue is that then I get 
a gTree object, not a ggplot object (I believe the option of building 
all objects off-screen and then printing the plot in whichever device 
we choose is the best option. That is indeed why I like your ggplot 
concept so much). I can live with that, of course, but there is a 
more fundamental issue here: why do axes have only ticks, and labels, 
and not line, as slots/children?  (I know it is also the underlying 
option in grid, but I cannot see the logic behind that...).

Cheers,
Pedro
At 04:29 2008/04/08, hadley wickham wrote:
>Hi Pedro,
>
> >  I am trying to print some simple ggplot plots, but I would like to
> >  have no gridlines, and no border.
> >  I have achieved this using ggopt(grid.lines='NA', border.lines='NA').
> >
> >  However, this also clears the axis lines, and reading the help, it
> >  looks like the "axis" objects have only two slots, "label" and "ticks".
> >
> >  How can I get rid of gridlines and border, and still keep the axis lines?
>
>There's no built in way to do this at the moment.  However you can
>always modify the underlying grid objects - see the last chapter of
>the ggplot2 book.
>
>Hadley
>
>
>--
>http://had.co.nz/



More information about the R-help mailing list