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.
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. >
On Feb 8, 2011, at 3:36 PM, 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 > displaysThose are the default settings: ?plot.default ... , xlab = NULL, ylab = NULL, ... xlab a label for the x axis, defaults to a description of x.> > 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) >> data(USSenate) Warning message: In data(USSenate) : data set 'USSenate' not found> Ive been able to get rid of it by xlab = " " but this is not > satisfactory as > the graph size must change as well.Either of the the following produce a plot with no xy-labels. And I see no change in plot size when going from one to the other. I don't understand what "... the graph size must change as well" means. > plot(1,1,xlab=NA, ylab=NA) > plot(1,1,xlab="", ylab="")> > 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.David Winsemius, MD West Hartford, CT
Have a look at ?par especially the "mar" argument, to get rid off the boundaries reserverd for labelling. Am 08.02.2011 21:36, schrieb poolmunch:> > 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...-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790
If you want to expand the area that the graph takes up (using the space that the labels would have been in) look at the "mar" part of ?par. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of poolmunch > Sent: Tuesday, February 08, 2011 1:37 PM > To: r-help at r-project.org > Subject: [R] Removing X and Y labels in graph error > > > 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.
Hey thanks for all the help, I did end up using layout, par, mar to reduce the labelling area and combine it with other plots. I also now understand NULL was the wrong argument to place in the field. Thanks again -- View this message in context: http://r.789695.n4.nabble.com/Removing-X-and-Y-labels-in-graph-error-tp3276950p3281527.html Sent from the R help mailing list archive at Nabble.com.