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

David Winsemius dwinsemius at comcast.net
Sun Nov 21 17:15:54 CET 2010

On Nov 21, 2010, at 11:02 AM, 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

?par for valid xaxt and yaxt values. And unlearn the use of NULL for  
argument values. You generally are going to want to provide something  
(NA or "") and in R NULL is "nothing".

See if this is closer to what you wanted

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="n", yaxt="n", xlab="",ylab="")


David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list