[R] x labels out of Quartz canvas
Hi R world, I am such a newbie, with only 4-5 days of R experience. I did a search in forum history but couldn't find a solution to my problem... Sorry if it's obvious: I managed to draw a barplot (yey!) with xlabels of 'long' names (filenames, to be particular). To make them readable, I place them perpendicular to the axis (las=2). When I do that, however, these names don't fit inside the Quartz window and they are truncated. Is there a way to change the Quartz window size after plotting (or, as an alternative, to scale the plot down so it fits in there) ? Thanks a lot! -Memo PS: This is the very first of my zillion of questions! -- View this message in context: http://www.nabble.com/x-labels-out-of-Quartz-canvas-tp17872830p17872830.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] x labels out of Quartz canvas
Thanks a lot! I looked at the document. It shows how to set the size of the canvas, but not how to change it *after* plotting. Now I start with a bigger canvas, but the plot is scaled into it, so I am having the same problem again :( I keep on reading tough. Thanks a lot for your help! -Memo Prof Brian Ripley wrote: > > You do this by adjusting the margin sizes. Can I suggest you read 'An > Introduction to R', which has a section on the layout of graphics (perhaps > the only area in which it is comprehensive). > > On Mon, 16 Jun 2008, MeMooMeM wrote: > >> >> Hi R world, >> >> I am such a newbie, with only 4-5 days of R experience. I did a search in >> forum history but couldn't find a solution to my problem... Sorry if it's >> obvious: >> >> I managed to draw a barplot (yey!) with xlabels of 'long' names >> (filenames, >> to be particular). To make them readable, I place them perpendicular to >> the >> axis (las=2). When I do that, however, these names don't fit inside the >> Quartz window and they are truncated. >> >> Is there a way to change the Quartz window size after plotting (or, as an >> alternative, to scale the plot down so it fits in there) ? >> >> Thanks a lot! >> >> -Memo >> >> PS: This is the very first of my zillion of questions! >> -- >> View this message in context: >> http://www.nabble.com/x-labels-out-of-Quartz-canvas-tp17872830p17872830.html >> Sent from the R help mailing list archive at Nabble.com. >> >> __ >> R-help@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. >> > > -- > Brian D. Ripley, [EMAIL PROTECTED] > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 > > __ > R-help@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. > > -- View this message in context: http://www.nabble.com/x-labels-out-of-Quartz-canvas-tp17872830p17935598.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Row and Col length of a matrix?
Hi, Is there a direct command to get the row and col length of a matrix? My ugly solution is: length(mtx[,1]) and length(bcf[1,]) Thanks! -- View this message in context: http://www.nabble.com/Row-and-Col-length-of-a-matrix--tp17936978p17936978.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] color2D.matplot axis names
Hi, I finally came up with a nice colored matrixplot, using the color2D.matplot function of the plotrix package. But I can't assign xtics and ytics to this plot. I made sure that the matrix has correct colnames() and rownames(). Here's what I do: a=matrix(1:16, 4, 4) colnames(a) <- c("X1", "X2", "X3", X4) rownames(a) <- c("Y1", "Y2", "Y3", "Y4") color2D.matplot(a,c(0,1),c(0,0),c(0,0),show.legend=TRUE, show.values=TRUE) As you can see from the output of these commands, the ticks are numbers, but not the names. Thank you so much in advance! -- View this message in context: http://www.nabble.com/color2D.matplot-axis-names-tp17948688p17948688.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] x labels out of Quartz canvas
Dr. Ripley, I appreciate all your help. The graph looks great now. Just in case someone searches for a similar problem: >You need to set the *margins* not the size of the canvas. See par's mai >and mar and the figures in that document. Here's how I do that: par(mar=c(7,7,7,7)) color2D.matplot(abs(cors),extremes=c("blue", "red"),show.legend=TRUE, show.values=TRUE, axes=FALSE, xlab="", ylab="") -- View this message in context: http://www.nabble.com/x-labels-out-of-Quartz-canvas-tp17872830p17985234.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.