[R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

Peter Ehlers ehlers at ucalgary.ca
Sun Nov 21 17:18:53 CET 2010


On 2010-11-21 08:02, madr wrote:
>
> here's the code
>
> x= c(1,5,7,3,4)
> y= c(2,4,5,2,5)
> plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0,
> 0.5), xaxt=NULL,yaxt=NULL, xlab=NULL,ylab=NULL)
>
> and x and y are still visible

If you just want to remove both axis titles (xlab and ylab),
use plot(...., ann = FALSE).

If you want both axes to be free of ticks, etc, use
plot(...., ann = FALSE, axes = FALSE). This will also
remove the 'box' around the plot; you can add that
back with

  plot(....)
  box()

It's useful to study the documentation for ?plot.default to
which you are directed by ?plot.

Peter Ehlers



More information about the R-help mailing list