[R] Removing X and Y labels in graph error

Phil Spector spector at stat.berkeley.edu
Tue Feb 8 23:03:37 CET 2011


Contrast the behaviour of these two statements:

> plot(x,y,xlab=NULL,ylab=NULL)
> plot(x,y,xlab='',ylab='')

In other words, use xlab='' to supress the label, not NULL.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu

On Tue, 8 Feb 2011, poolmunch wrote:

>
> Hello, had a quick search on the site but no luck.
>
> Heres my problem, when attempting to xlab = NULL and ylab = NULL it displays
>
> x[[1L]] and X[[2L]] as labels on the axis.
>
> plot(USSenate[,1:2],col=c("blue","grey","red")[unclass(USSenate$Senate)],pch=unclass(USSenate$Senate),
> type="n",xaxt="n", yaxt="n",main = NULL, sub = NULL, xlab = NULL, ylab =
> NULL)
>
>
>
>
> Ive been able to get rid of it by xlab = " " but this is not satisfactory as
> the graph size must change as well.
>
> Thanks to anyone who has a look at what must be a stupid question...
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Removing-X-and-Y-labels-in-graph-error-tp3276738p3276738.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list