Skip to content

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

6 messages · madr, Luke Miller, David Winsemius +1 more

#
On Nov 21, 2010, at 10:21 AM, madr wrote:

            
The term "labels" as used in functions is different than the graphical  
objects affected by xlab and ylab. Those are really "titles"

?title

?plot.default  # which you should have consulted while you were using  
the help(plot) information.

Use one of "axes", "xaxt" or "yaxt" To indicate both or which axis to  
suppress.
#
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
#
On Nov 21, 2010, at 11:02 AM, madr wrote:

            
?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="")
#
On 2010-11-21 08:02, madr wrote:
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