Re: [R] graphics edge in win.metafile?
Try using Paste, Special in WORD or PowerPoint. The graphic will be slightly smaller too but I find the size is just right. What works better for me, but does require some forethought, is something like this: graphics.off() windows(width = 5.8, height = 5.8, pointsize = 12) par(mar = c(4.5, 4.5, 4, 0.5) + 0.1)# -- sized to fit your graphic. ###Customizing par() may solve your cut paste problem, too. ### ### graphic generating logic goes here. ### savePlot(graphic name, type = wmf) The rather than cut paste, I use WORD or PowerPoint's insert to point to the new graphic. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LL Sent: Saturday, May 26, 2007 1:14 PM To: LL; r-help@stat.math.ethz.ch Subject: [R] graphics edge in win.metafile? Hi... I copy a plot to the clipboard via win.metafile and then paste the clipboard into a powerpoint show. The problem is that there is considerable white space between the edges of the plot and the figure pasted into powerpoint. I've tried many par settings to get less white space between the plot sides and the bounding box.. but haven't succeeded. win.metafile(, height=3, width=3) plot(1:10) dev.off() Thanks, Lance [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] graphics edge in win.metafile?
Thanks Charles. I just discovered that I get much better behavior if I write the graph to a normal R graphics window, right click and select copy as metafile, and paste the result normally into powerpoint. - Original Message - From: Charles Annis, P.E. [EMAIL PROTECTED] To: 'LL' [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Sent: Saturday, May 26, 2007 7:46 PM Subject: RE: [R] graphics edge in win.metafile? Try using Paste, Special in WORD or PowerPoint. The graphic will be slightly smaller too but I find the size is just right. What works better for me, but does require some forethought, is something like this: graphics.off() windows(width = 5.8, height = 5.8, pointsize = 12) par(mar = c(4.5, 4.5, 4, 0.5) + 0.1)# -- sized to fit your graphic. ###Customizing par() may solve your cut paste problem, too. ### ### graphic generating logic goes here. ### savePlot(graphic name, type = wmf) The rather than cut paste, I use WORD or PowerPoint's insert to point to the new graphic. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LL Sent: Saturday, May 26, 2007 1:14 PM To: LL; r-help@stat.math.ethz.ch Subject: [R] graphics edge in win.metafile? Hi... I copy a plot to the clipboard via win.metafile and then paste the clipboard into a powerpoint show. The problem is that there is considerable white space between the edges of the plot and the figure pasted into powerpoint. I've tried many par settings to get less white space between the plot sides and the bounding box.. but haven't succeeded. win.metafile(, height=3, width=3) plot(1:10) dev.off() Thanks, Lance [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] graphics edge in win.metafile?
You can always use the 'crop' feature in PowerPoint to get the graphics the way you want them. On 5/26/07, LL [EMAIL PROTECTED] wrote: Thanks Charles. I just discovered that I get much better behavior if I write the graph to a normal R graphics window, right click and select copy as metafile, and paste the result normally into powerpoint. - Original Message - From: Charles Annis, P.E. [EMAIL PROTECTED] To: 'LL' [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Sent: Saturday, May 26, 2007 7:46 PM Subject: RE: [R] graphics edge in win.metafile? Try using Paste, Special in WORD or PowerPoint. The graphic will be slightly smaller too but I find the size is just right. What works better for me, but does require some forethought, is something like this: graphics.off() windows(width = 5.8, height = 5.8, pointsize = 12) par(mar = c(4.5, 4.5, 4, 0.5) + 0.1)# -- sized to fit your graphic. ###Customizing par() may solve your cut paste problem, too. ### ### graphic generating logic goes here. ### savePlot(graphic name, type = wmf) The rather than cut paste, I use WORD or PowerPoint's insert to point to the new graphic. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LL Sent: Saturday, May 26, 2007 1:14 PM To: LL; r-help@stat.math.ethz.ch Subject: [R] graphics edge in win.metafile? Hi... I copy a plot to the clipboard via win.metafile and then paste the clipboard into a powerpoint show. The problem is that there is considerable white space between the edges of the plot and the figure pasted into powerpoint. I've tried many par settings to get less white space between the plot sides and the bounding box.. but haven't succeeded. win.metafile(, height=3, width=3) plot(1:10) dev.off() Thanks, Lance [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] graphics on Ubunut
Well, i had this problem too, but with Edy edge 5.06. I fixed the problem after reading this. http://ubuntuforums.org/archive/index.php/t-248750.html http://ubuntuforums.org/archive/index.php/t-248750.html But I also updated to Feisty Fawn (5.10) and there the problem didn't occur. I'm not sure if the configuration file changed after the update (or if it was left untouched). I hope this information helps -- View this message in context: http://www.nabble.com/graphics-on-Ubunut-tf3781004.html#a10732427 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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] graphics on Ubunut
On 18 May 2007 at 20:25, Erin Hodgess wrote: | Dear R People: | | I'm working with R on the latest version of Ubuntu. | | However, I can't get graphics to appear, even with the | simplest plot commands. What does this show for you: capabilities()[X11] X11 TRUE If you get 'FALSE', and by chance you built this yourself, then you probably omitted to install the X11 development packages, and overlooked the warning that configure gave you. You could consider installing the prebuilt Ubuntu binaries that are provided via CRAN and its mirrors; see the R FAQ. Hth, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison __ R-help@stat.math.ethz.ch 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] graphics question: tilted axis labels?
Your problem is different I think, it's the fact that LA$countries is a factor, and hence you see the factor levels instead of their labels. Try: # create data frame LA - data.frame(countries=c(Chile, Peru, Bolivia), values=c (10, 12, 13), stringsAsFactors = FALSE) # call barplot barplot(LA$values, names.arg=LA$countries) On Apr 13, 2007, at 9:02 AM, Christoph Heibl wrote: I´m sorry, I did not provide any code. Here is now a small example: # create data frame LA - data.frame(countries=c(Chile, Peru, Bolivia), values=c (10, 12, 13)) # call barplot barplot(LA$values, names.arg=LA$countries) # Countries names are not plotted, but their index numbers instead. # So again the question: # How can I tilt the angles in order to make whole names fit? Thanks Christoph Haris Skiadas Department of Mathematics and Computer Science Hanover College __ [EMAIL PROTECTED] 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] graphics question: tilted axis labels?
Dear Charilaos, Thanks ... your were right. I now get the names. But the problems remains that the space (30 items) is insufficient to bear all the names and I am still looking for a way to accommodate them. Do you know of any solution? Cheers, Christoph On 13.04.2007, at 15:27, Charilaos Skiadas wrote: # create data frame LA - data.frame(countries=c(Chile, Peru, Bolivia), values=c (10, 12, 13), stringsAsFactors = FALSE) # call barplot barplot(LA$values, names.arg=LA$countries) [[alternative HTML version deleted]] __ [EMAIL PROTECTED] 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] graphics question: tilted axis labels?
Hi, I would like to draw a barplot where items are countries and, in order to fit the country´s names in, tilt these names about 45°. Is this possible? I cannot find any examples in the docs. I think it is in the FAQ : http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f Hope that helps, -- Julien __ [EMAIL PROTECTED] 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] graphics question: tilted axis labels?
On Apr 13, 2007, at 9:52 AM, Christoph Heibl wrote: Dear Charilaos, Thanks ... your were right. I now get the names. But the problems remains that the space (30 items) is insufficient to bear all the names and I am still looking for a way to accommodate them. Do you know of any solution? Frankly, if you have a barplot with 30 items, I would rethink the situation if I were you. As an audience, I would find it hard to process such a graph. Put it might just be me. I personally think that tilting them 45, or even 90 degrees is not a very good idea presentation-wise, and opt instead to have the barplots be horizontal when something like this happens (barplot (...,horiz=TRUE) ). If you look at ?par, you'll find the options crt and srt, which don't seem to work on the axes, and also have a big warning about not expecting a 45 degree tilt to always work. You can use las to turn it 90 degrees if you really want that. I think lattice and grid would allow you perhaps to do exactly what you want, though it might be somewhat more work. Sorry, perhaps I was more critical than helpful. Best of luck with it. PS: Why do drawing commands have different names for the horizontal attribute? boxplot - horizontal barplot - horiz Cheers, Christoph On 13.04.2007, at 15:27, Charilaos Skiadas wrote: # create data frame LA - data.frame(countries=c(Chile, Peru, Bolivia), values=c (10, 12, 13), stringsAsFactors = FALSE) # call barplot barplot(LA$values, names.arg=LA$countries) Haris Skiadas Department of Mathematics and Computer Science Hanover College __ [EMAIL PROTECTED] 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] graphics - wireframe
Bruno Churata bruno.rproject at gmail.com writes: Hi, I would like to know about graphics for response surface in R. What are arguments for a best graphics? Thanks for giving a reproducible example [snipped], but it's not clear what you need to know. Are you wondering whether there are general design standards for 3d perspective plots? (There's a little bit in Cleveland's Visualizing data.) I'm afraid the general answer is play around with the parameters until you think it looks good. You could also try rgl: y - c(66,39,43,49,58,17,-5,-40,65,7,43,-22,-31,-35,-26) x1 - c(-1,1,-1,1,-1,1,-1,1,rep(0,7)) x2 - c(-1,-1,1,1,0,0,0,0,-1,1,-1,1,0,0,0) library(rgl) ym = xtabs(y~x1+x2) persp3d(as.numeric(rownames(ym)),as.numeric(colnames(ym)),ym, xlab=x1,ylab=x2,col=gray) unfortunately, there's not (yet?) any easy way to get filled + lines on the surface; using front=line will get you a wireframe (see ?rgl.material). http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-3d:graphics-3d good luck Ben Bolker __ [EMAIL PROTECTED] 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] graphics - wireframe
If you are just trying to find the best set of rotation values to view your surface then the rotate.wireframe function in the TeachingDemos package may help. Unfortunately it is not currently working out of the box (a parameter name was changed in the lattice functions, I will fix this for version 1.6 of TeachingDemos). You can easily fix the problem and get it working by doing: fix(rotate.wireframe) Then find the line that is currently (line number 31): wire.options$formula - formula And change it to wire.options$x - formula Then it should work for you. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Churata Sent: Friday, April 13, 2007 8:11 AM To: [EMAIL PROTECTED] Subject: [R] graphics - wireframe Hi, I would like to know about graphics for response surface in R. What are arguments for a best graphics? thanks, Bruno y - c(66,39,43,49,58,17,-5,-40,65,7,43,-22,-31,-35,-26) x1 - c(-1,1,-1,1,-1,1,-1,1,rep(0,7)) x2 - c(-1,-1,1,1,0,0,0,0,-1,1,-1,1,0,0,0) wireframe( y ~ x1*x2 , scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE, screen = list(z = 30, x = -60), distance = .4, zoom = .8 ) [[alternative HTML version deleted]] __ [EMAIL PROTECTED] 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. __ [EMAIL PROTECTED] 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] graphics not find source
Ricardo Arias Brito ricardo_ariasbrito at yahoo.com.br writes: Hi, The plot function not produces graphics in linux. The msg: Error in X11(): it was not possible to find no source X11 Verifity if the way of sources is correct. Any ideas? Thanks, Ricardo This is too vague for us to help you; I would also be extremely surprised if these are the exact text of the error messages! Please: * start R with the --vanilla option * tell us _exactly_ which commands you ran (cutting and pasting would be a good idea) * tell us exactly what error message you go (ditto on cutting and pasting) * type version and cut and paste the results * tell us what distribution and version of Linux you're using You might get some help after that. Ben Bolker __ R-help@stat.math.ethz.ch 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] graphics not find source
Ricardo Arias Brito [EMAIL PROTECTED] writes: Hi, The plot function not produces graphics in linux. The msg: Error in X11(): it was not possible to find no source X11 Verifity if the way of sources is correct. Any ideas? Hmm, maybe you shouldn't have tried to translate the message back to English I believe there is a similar message that has to do with _fonts_. If so, then the problem could be related to the font path or to locale issues. What happens if you do LC_ALL=C R ? It could be useful to know more about your system than linux. Which distribution and which version? Compiled yourself or installed from binaries? -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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] graphics ignore tabs in text
On Tue, 2006-10-31 at 09:13 -0500, Liaw, Andy wrote: Dear R-help, I seem to recall that I can use \t to get tab in a string on a graphics device, but it doesn't seem to work. Try: lab - a\tb\tc cat(lab, \n) # works in the console output plot(1:5, main=lab) # no tabs in the title text(3, 3, lab) # no tabs in the text I get the same result both in the windows() and pdf() devices. Any ideas? This is R-patched Windows binary just downloaded from CRAN. R version 2.4.0 Patched (2006-10-29 r39744) Best, Andy Andy, I don't believe that tab expansion works in plots, though I will stand to be corrected on that. Using the X11() device on FC5 (which I recreated using png() and attached here), you can clearly see the dashed boxes where the tab character (non-printable 0x9) is being drawn. However, it is one character, not expanded as is the case in a textual console/GUI. What are you trying to accomplish? Perhaps there is a better way (ie. to do column alignments, etc.) such as textplot() in the gplots package. HTH, Marc Schwartz Rplot001.png Description: PNG image __ R-help@stat.math.ethz.ch 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] graphics ignore tabs in text
Hi Marc Schwartz wrote: On Tue, 2006-10-31 at 09:13 -0500, Liaw, Andy wrote: Dear R-help, I seem to recall that I can use \t to get tab in a string on a graphics device, but it doesn't seem to work. Try: lab - a\tb\tc cat(lab, \n) # works in the console output plot(1:5, main=lab) # no tabs in the title text(3, 3, lab) # no tabs in the text I get the same result both in the windows() and pdf() devices. Any ideas? This is R-patched Windows binary just downloaded from CRAN. R version 2.4.0 Patched (2006-10-29 r39744) Best, Andy Andy, I don't believe that tab expansion works in plots, though I will stand to be corrected on that. I'm surprised that this has never come up before, but I know of no special handling of tabs in the graphics code. I suspect if we wanted to do something we would have to add code to detect '\t' and replace it with a number of spaces (maybe based on a user-settable option). Paul Using the X11() device on FC5 (which I recreated using png() and attached here), you can clearly see the dashed boxes where the tab character (non-printable 0x9) is being drawn. However, it is one character, not expanded as is the case in a textual console/GUI. What are you trying to accomplish? Perhaps there is a better way (ie. to do column alignments, etc.) such as textplot() in the gplots package. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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. -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ R-help@stat.math.ethz.ch 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] graphics and 'layout' question
[EMAIL PROTECTED] wrote: Hello, I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R? Are you looking for the heights argument? For example: nf - layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE), heights=c(70,30)) layout.show(nf) thanks a lot for your help, Arne __ R-help@stat.math.ethz.ch 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. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch 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] graphics and 'layout' question
Use the heights parameter in the layout function, as shown in ?layout. For example, to get the first figure to be twice as tall as the other two, use: layout(matrix(c(1,1,2,3),2,2,byrow=TRUE),heights=c(2,1)) layout.show(3) On 15/09/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R? thanks a lot for your help, Arne __ R-help@stat.math.ethz.ch 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 Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] graphics and 'layout' question
[EMAIL PROTECTED] wrote: Hello, I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R? From ?layout heights: a vector of values for the heights of rows on the device. Relative and absolute heights can be specified, see 'widths' above. So something like layout(matrix(c(1,1,2,3),2,2,byrow = TRUE), heights = c(0.6, 0.4)) should do the trick. Best, Jim thanks a lot for your help, Arne __ R-help@stat.math.ethz.ch 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. -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues. __ R-help@stat.math.ethz.ch 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] graphics: y limit on xyplot
It should have length 2, i.e. lower limit and upper limit. On 9/11/06, Murray Pung [EMAIL PROTECTED] wrote: I would like to set the y axis limit of an xyplot using the object 'ylimit', but receive this error: [1] 990 Error in extend.limits(limitlist[[i]], axs = axs) : improper length of lim I get the same error if I use ylim. library(lattice) trellis.device(col = FALSE, theme = lattice.getOption(col.whitebg)) name - Variable name symbols - c(1,2,3,4,5,6,7,8,9) patientp - c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9) varp - c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33) visitp - c(1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3) yall - c(varp,varl,varm,varh) ylimit - max(yall)*1.1 xyplot(varp ~ visitp, xlab = Visit, ylab = name, group = patientp, type = b, lty = 1, as.table = TRUE, main = list(Placebo,cex = 1.0), scales = list(relation = free,x = list(tick.number = 1,at = c(1,3)),y = list(limits = ylimit)), auto.key = list(space = right,cex = 1.1), par.settings = list(superpose.symbol = list(pch = symbols,cex = 1.1))) -- Murray Pung Statistician, Datapharm Australia Pty Ltd 0404 273 283 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] graphics - joining repeated measures with a line
I would like to join repeated measures for patients across two visits using a line. The program below uses symbols to represent each patient. Basically, I would like to join each pair of symbols. This is easy in ggplot: install.packages(ggplot) library(ggplot) qplot(visit, var, id=patient, type=c(line, point), colour=factor(patient)) Regards, Hadley __ R-help@stat.math.ethz.ch 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] graphics - joining repeated measures with a line
Make each pair of points a separate group using group= and specify that both points and lines be used via type = b. Also set the symbols in par.settings= so that they are accessed by both the main plot and the legend: xyplot(var ~ visit, group = symbols[patient], type = b, auto.key = list(space = right), par.settings = list(superpose.symbol = list(pch = symbols))) On 9/6/06, Murray Pung [EMAIL PROTECTED] wrote: I would like to join repeated measures for patients across two visits using a line. The program below uses symbols to represent each patient. Basically, I would like to join each pair of symbols. library(lattice) patient - c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9) var - c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33) visit - c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2) symbols - c(1,2,3,4,5,6,7,8,9) xyplot(var ~ visit, pch = symbols[patient], key = list(points = list(pch = symbols), space = list(right),text = list(c(1,2,3,4,5,6,7,8,9 # grid.lines(x = visit,y = var,draw = TRUE) ?? I am thinking I may need to use a function that joins coordinates (for example join (1,826) with (2,900)), but am hoping there may be a better way. Thanks for any help. Murray -- Murray Pung Statistician, Datapharm Australia Pty Ltd 0404 273 283 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] graphics - joining repeated measures with a line
Just one correction (although in this case it does not change the output) -- use group = patient rather than group = symbol[patient]: xyplot(var ~ visit, group = patient, type = b, auto.key = list(space = right), par.settings = list(superpose.symbol = list(pch = symbols))) On 9/6/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Make each pair of points a separate group using group= and specify that both points and lines be used via type = b. Also set the symbols in par.settings= so that they are accessed by both the main plot and the legend: xyplot(var ~ visit, group = symbols[patient], type = b, auto.key = list(space = right), par.settings = list(superpose.symbol = list(pch = symbols))) On 9/6/06, Murray Pung [EMAIL PROTECTED] wrote: I would like to join repeated measures for patients across two visits using a line. The program below uses symbols to represent each patient. Basically, I would like to join each pair of symbols. library(lattice) patient - c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9) var - c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33) visit - c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2) symbols - c(1,2,3,4,5,6,7,8,9) xyplot(var ~ visit, pch = symbols[patient], key = list(points = list(pch = symbols), space = list(right),text = list(c(1,2,3,4,5,6,7,8,9 # grid.lines(x = visit,y = var,draw = TRUE) ?? I am thinking I may need to use a function that joins coordinates (for example join (1,826) with (2,900)), but am hoping there may be a better way. Thanks for any help. Murray -- Murray Pung Statistician, Datapharm Australia Pty Ltd 0404 273 283 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Graphics device size
On Tue, 11 Apr 2006, Christos Hatzis wrote: Dear All, When working with composite plots many times I have to manually adjust the graphics display window size to get the best results (in Windows XP). I can then find the size of the adjusted window in inches using par(din). Now I would like to export the adjusted graphs as png's and have them look as close to the original display as possible. The problem is that the png device accepts size arguments in pixels so that I need to convert inches to pixels. Is there a way to get the default pixels-per-inch that the windows device uses? RSiteSearch(ppi) did not return any helpful hints. Well, yes, but only by calling the Win API for your own C code. It is often not very accurate. Interestingly, it is actually in pixels per cm. What is harder is to do is to find out how large you have resized the graphics window to. Since in fact that is stored in pixels, you don't need the pixels-per-inch, but I can see no way to do this without C code (the info is both in the private structure defined in devWindows.h and in the device-driver structure via right - left, bottom - top). -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics device size
On Tue, 11 Apr 2006, Prof Brian Ripley wrote: On Tue, 11 Apr 2006, Christos Hatzis wrote: Dear All, When working with composite plots many times I have to manually adjust the graphics display window size to get the best results (in Windows XP). I can then find the size of the adjusted window in inches using par(din). Now I would like to export the adjusted graphs as png's and have them look as close to the original display as possible. The problem is that the png device accepts size arguments in pixels so that I need to convert inches to pixels. Is there a way to get the default pixels-per-inch that the windows device uses? RSiteSearch(ppi) did not return any helpful hints. Well, yes, but only by calling the Win API for your own C code. It is often not very accurate. Interestingly, it is actually in pixels per cm. What is harder is to do is to find out how large you have resized the graphics window to. Since in fact that is stored in pixels, you don't need the pixels-per-inch, but I can see no way to do this without C code (the info is both in the private structure defined in devWindows.h and in the device-driver structure via right - left, bottom - top). Doesn't savePlot(, type=png) do everything that you might want here? -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics device size
Actually it does. Thank you, Prof. Ripley. -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 1:26 PM To: Christos Hatzis Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Graphics device size On Tue, 11 Apr 2006, Prof Brian Ripley wrote: On Tue, 11 Apr 2006, Christos Hatzis wrote: Dear All, When working with composite plots many times I have to manually adjust the graphics display window size to get the best results (in Windows XP). I can then find the size of the adjusted window in inches using par(din). Now I would like to export the adjusted graphs as png's and have them look as close to the original display as possible. The problem is that the png device accepts size arguments in pixels so that I need to convert inches to pixels. Is there a way to get the default pixels-per-inch that the windows device uses? RSiteSearch(ppi) did not return any helpful hints. Well, yes, but only by calling the Win API for your own C code. It is often not very accurate. Interestingly, it is actually in pixels per cm. What is harder is to do is to find out how large you have resized the graphics window to. Since in fact that is stored in pixels, you don't need the pixels-per-inch, but I can see no way to do this without C code (the info is both in the private structure defined in devWindows.h and in the device-driver structure via right - left, bottom - top). Doesn't savePlot(, type=png) do everything that you might want here? -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics question
try the following: plot(..., xaxt = n) axis(1, at = 1:2) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Bowden, J.M. [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Thursday, March 02, 2006 4:41 PM Subject: [R] Graphics question Hi I am trying to plot two points (with confidence intervals) on a graph to illustrate the value of a particular quantity after 1 and 2 iterations respectively. I'm doing this by plot(cycle,alpha[2,],main=,ylim=c(-8,-3),cex=2,col=red,pch=19,ylab=e xpression(alpha),xlab=cycle) Etc.. Where cycle [1] 1 2 alpha [,1] [,2] [1,] -6.227266 -5.762146 [2,] -5.200972 -5.010401 [3,] -4.174677 -4.258655 When I plot this I get the x-axis scale reading 1.0,1.1,1.2,...,2.0 I want to get it to read simply 12 Is there an easy way to do this? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics: axis label
Johannes Hüsing wrote: Hello, par(las=1) sets the orientation of the axis labels to horizontal. That is, the tick mark labels. How do I set the orientation of the axis label, which annotates the variable plotted along the axis, to horizontal? Sorry for asking such a basic question here, but I haven't found anything in the description of the pars. You have to use a call to text() and place it into the margins by specifying, e.g., par(xpd=TRUE) as in: plot(1:10, ylab=) par(xpd=TRUE, mar=c(4,8,0,0)+.1) text(0, 5.5, Hallo Johannes!, adj=1) Uwe Greetings Johannes __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics pages?
Erin Hodgess wrote: Dear R People: In S Plus, if you have a function which calls the plot function several times, you get several pages of graphics output. Is there an eqivalent in R, please? Yes, for e.g. postscript() and pdf() devices the default is to plot each new plot on a separate page. Uwe Ligges R version 2.2.1 windows Thanks in advance! Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics pages?
On Tue, 10 Jan 2006, Erin Hodgess wrote: Dear R People: In S Plus, if you have a function which calls the plot function several times, you get several pages of graphics output. Only on a graphsheet, I believe. Is there an eqivalent in R, please? Pretty close, on a windows() device. Look for `record' on its help page, or look at the README.R-2.2.1 or the rw-FAQ or explore the history menu on the device. -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics question on putting axes in the margins
Peter Flom wrote: which I did using mfrow = c(3,3). I'd like to use the space on the page as efficiently as possible,so I made the margins small, but that leaves no space for axes. Is there a way to put axes only along the bottom and left side, so that a) The individual qqplots maintain their shape and b) less space on the page is taken up by white space? Take a look at the code for plot.ts(..., plot.type=multiple). It uses plot(..., axes=F), followed by calls to box() and axis(). __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics window always overlaps console window!
On Tue, 2005-10-25 at 11:55 -0600, [EMAIL PROTECTED] wrote: Does anyone know how I can set up R so that when I make a graphic, the graphics window remains behind the console window? It's annoying to have to reach for the mouse every time I want to type another line of code (e.g., to add another line to the plot). Thanks. What operating system? Default window focus behavior is highly OS and even window manager specific and is not an R issue. Depending upon your OS and window manager, you may need to check the documentation and/or do a Google search on window focus for further information. Another alternative, if you are on Windows, is to review Windows FAQ 5.4 How do I move focus to a graphics window or the console?, but this is a programmatic approach and not a means to affect default behavior. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics window always overlaps console window!
Does anyone know how I can set up R so that when I make a graphic, the graphics window remains behind the console window? It's annoying to have to reach for the mouse every time I want to type another line of code (e.g., to add another line to the plot). Thanks. What OS? In Windows with R GUI I use ctrl-Tab to cycle from the console, to graphics, to help, etc. -Andy __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics window always overlaps console window!
On Tue, 2005-10-25 at 13:07 -0500, Marc Schwartz (via MN) wrote: On Tue, 2005-10-25 at 11:55 -0600, [EMAIL PROTECTED] wrote: Does anyone know how I can set up R so that when I make a graphic, the graphics window remains behind the console window? It's annoying to have to reach for the mouse every time I want to type another line of code (e.g., to add another line to the plot). Thanks. What operating system? Default window focus behavior is highly OS and even window manager specific and is not an R issue. Depending upon your OS and window manager, you may need to check the documentation and/or do a Google search on window focus for further information. Another alternative, if you are on Windows, is to review Windows FAQ 5.4 How do I move focus to a graphics window or the console?, but this is a programmatic approach and not a means to affect default behavior. Yet another approach which I just remembered is that (if on Windows) MS offers a program called Tweak UI: http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx as part of their Power Toys add-ons. You might want to review that to see if there is a setting for the handling of new window focus behavior. HTH, Marc __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics window always overlaps console window!
[EMAIL PROTECTED] wrote: Does anyone know how I can set up R so that when I make a graphic, the graphics window remains behind the console window? It's annoying to have to reach for the mouse every time I want to type another line of code (e.g., to add another line to the plot). Thanks. I don't see this behaviour on Windows XP, except when a graphics window is first opened. And Ctrl-Tab toggles the windows. No mouse! Peter Ehlers __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics window always overlaps console window!
Thanks for your replies, I was unaware of these solutions. On 10/25/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Does anyone know how I can set up R so that when I make a graphic, the graphics window remains behind the console window? It's annoying to have to reach for the mouse every time I want to type another line of code (e.g., to add another line to the plot). Thanks. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics guide?
At the R website, CRAN, in the Manuals section, you can download the document titled An Introduction to R, which contains a substantial section on the basics of R graphics. -Don At 3:27 PM +0200 9/27/05, Karin Lagesen wrote: I am trying to create some graphs with R and it seems to be able to do what I need. However, I have so far not been able to find any sort of explanation of how the graphics system works. I am for instance trying to create a multiple figure, and I seem to have to call plot.new() before every new plot command, I have however not found any explanation of what this actually does. ?plot.new does give an explanation, but it is explained in R, so to speak. Where do I find out what for instance a graphics frame is? Thanks, Karin -- Karin Lagesen, PhD student [EMAIL PROTECTED] http://www.cmbn.no/rognes/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- -- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics guide?
Hi, Karin Lagesen wrote: I am trying to create some graphs with R and it seems to be able to do what I need. However, I have so far not been able to find any sort of explanation of how the graphics system works. I am for instance trying to create a multiple figure, and I seem to have to call plot.new() before every new plot command, I have however not found any Do you mean several graphs in the same window? If so, you want something like, e.g.: par(mfrow = c(2, 2)) Take a look at ?par and the mfrow or mfcol options. Cheers and HTH, Kev -- Ko-Kang Kevin Wang PhD Student Centre for Bioinformation Science Building 27, Room 1004 Mathematical Sciences Institute (MSI) Australian National University Canberra, ACT 2601 Australia Homepage: http://wwwmaths.anu.edu.au/~wangk/ Ph (W): +61-2-6125-2431 Ph (H): +61-2-6125-7488 Ph (M): +61-40-451-8301 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics guide?
Karin Lagesen [EMAIL PROTECTED] 9/27/2005 9:27:29 AM I am trying to create some graphs with R and it seems to be able to do what I need. However, I have so far not been able to find any sort of explanation of how the graphics system works. I am for instance trying to create a multiple figure, and I seem to have to call plot.new() before every new plot command, I have however not found any explanation of what this actually does. ?plot.new does give an explanation, but it is explained in R, so to speak. Where do I find out what for instance a graphics frame is? If you'd like a more comprehensive reference in book form, I recommend Paul Murrell's book R Graphics. HTH Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St http://cduhr.ndri.org www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics 'snapshots' in Linux?
Quoting Tyler Smith [EMAIL PROTECTED]: Hi, I'm working on a MEPIS (Debian-based Linux) computer, using the emacs/ESS package to do my R work. I've got some plots that I label interactively using the locate function. With the Windows GUI there is an option to take a snapshot of the graphics output, saving it as an image file. Is there a way to do this with emacs/ESS? In the graphics menu, you could use ksnapshot. -- Jean-Luc __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics 'snapshots' in Linux?
On Thu, 2005-09-15 at 10:43 -0400, Tyler Smith wrote: Hi, I'm working on a MEPIS (Debian-based Linux) computer, using the emacs/ESS package to do my R work. I've got some plots that I label interactively using the locate function. With the Windows GUI there is an option to take a snapshot of the graphics output, saving it as an image file. Is there a way to do this with emacs/ESS? Thanks, Tyler Tyler, Take a look at ?dev.copy2eps and on the same page dev.copy(), which enable you to copy the current X11 plot supported output devices. You could do something like the following for an EPS file: plot(1:5) text(locator(1), Place Text Here) dev.copy2eps(file = MyPlot.eps) or the following for a PNG file: par(bg = white) plot(1:5) text(locator(1), Place Text Here) dev.copy(device = png, file = MyPlot.png) dev.off() Note that in the first example, dev.off() is not required, as the EPS output device is closed after the call. Also, note in the second example, you will need to set the background to white (unless already specified for whatever color you may be using), as the default output file will have a transparent background, even though the png() function shows the default as white. If my memory is correct this is because the X11 device itself has a transparent background by default and this is what is copied. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics support in R help files
I cannot state this with the certainty that others might, but the Rd format is a text format. If you want to produce something else then you need to choose an alternative method. For instance, 1.4 of Writing R Extensions notes that Documents in 'inst/doc' can be in arbitrary format, however we strongly recommend to provide them in PDF format, such that users on all platforms can easily read them. Tom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Leonard Kannapell Sent: Thursday, 8 September 2005 8:07 AM To: r-help@stat.math.ethz.ch Subject: [R] graphics support in R help files I looked through the Writing R Extensions pdf, and I don't see how graphics can be input in help files. For example, if I had a .eps plot that I wanted to include in a help file, what would the syntax be to include it in an R help file? If there is graphics support in help files, which format are supported (e.g., gif, png, jpg, eps, ps)? Thanks, -Len Kannapell __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics
On 8/30/05, Karsten Rincke [EMAIL PROTECTED] wrote: Hello, I guess a have a very simple problem though up to now couldn't solve it: I want to plot two datasets wihtin one plot like plot(x) provides it for one dataset(type=b that is: points connected by lines). Example data 'x': Befragung1 Befragung2 Befragung3 Geschlecht 2.25 2.34 1.78 weiblich 1.34 3.45 2.23 maennlich The two rows of the example above form two datasets. Now I'm looking for something like plot(~x |Geschlecht, ... ): X-axis containing Befragung1...3, y-axis containing the values given by the matrix 'x', points within one dataset (row of 'x') connected by lines. I already tried various possibilities provided by 'lattice' or 'grid' - but there seems to be a basic misunderstanding on my side so that I could not produce any good result. Would by very happy to get some hints! R likes data vectors to be columns, not rows. With your data, you could try matplot(t(mydata[, 1:3]), type = 'b') but it would probably make more sense to have the data in a different format to begin with. It could either be in the `wide' format: Befragung weiblich maennlich 1 2.25 1.34 2 2.34 3.45 3 1.78 2.23 or the `long' format: Befragung y Geschlecht 1 2.25 weiblich 2 2.34 weiblich 3 1.78 weiblich 1 1.34 maennlich 2 3.45 maennlich 3 2.23 maennlich With the wide format you could use matplot as before, or use xyplot from lattice: mydata - read.table(textConnection( Befragung weiblich maennlich 1 2.25 1.34 2 2.34 3.45 3 1.78 2.23), header = TRUE) xyplot(maennlich + weiblich ~ Befragung, data = mydata, type = 'b', auto.key = TRUE) With the long format, you could similarly do: mydata - read.table(textConnection( Befragung y Geschlecht 1 2.25 weiblich 2 2.34 weiblich 3 1.78 weiblich 1 1.34 maennlich 2 3.45 maennlich 3 2.23 maennlich ), header = TRUE) xyplot(y ~ Befragung, data = mydata, groups = Geschlecht, type = 'b', auto.key = TRUE) Hope that helps, -Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics on MacOSX
Yet another approach is to create a postscript file on R for MacOSX and convert to a windows metafile is: postscript(test.ps, width=5.0, height=6.0, paper=special) xyplot(1~1) dev.off Then, using the free/included MacOSX bundled software, GraphicConverter, convert the just-created postscript file to a WMF, (Windows Metafile Graphics), format. (This software has a batch conversion utility for converting multiple graphs--just select the multiple files and off you go.) Then, just import the newly converted .wmf files as you normally would into MS Word/MS Powerpoint. One (tiny) detail, though, is there is a bit of cropping you may have to do as the paper size, at least on mine, defaulted to letter, (which is the default). The paper size did not restrict itself to the 5x6 I specified earlier, but rather just the image size, (as advertised in the documentation.) However, the final printed product is as you wish--quality commensurate with the Win32 version. Good luck, Charles On Aug 4, 2005, at 9:13 AM, Martin Henry H. Stevens wrote: This is a big issue for me, causing many days of angst. I finally stumbled on the following solution. I create a device save an image with postscript(). I then open it in Adobe Acrobat, select the area I want, enlarge to at least 400%, then copy, then paste into PowerPoint or Word. Alternatively, you can simply save a graphics image through the gui and it saves it as pdf. Then go through the steps of selecting, enlarging and copying in Acrobat. I am guessing real graphics programs would work as well (Photoshop or Illustrator), but I don't have those. Hank Stevens On Aug 4, 2005, at 8:03 AM, Weismann_D wrote: Ist there a possibility on MacOSX to import Graphics into MSOffice Applications and resize them there without decreased quality? When I import via copypaste I get low quality bitmaps and via import pictures (pdf) it is all the same. In the Windows versions of R there is the convienient way to use metafile format which can easily be resized in ppt and word. What is the equivalent way on MacOSX? Thanks, Dirk. You could try creating a PNG with bitmap() using a high resolution, e.g., bitmap(test.png, type = png256, res = 1200) plot(1:10, rnorm(10)) dev.off() Preview can read the resulting PNG file just fine and the Windows version of Office can insert PNGs, displays them well, and allows resizing. (I don't have an OS X version of Office so can't test that the OS X version would handle the PNGs equally well but I would have to assume it does.) bitmap() requires Ghostscript which I have installed on my system in /usr/local/bin. I'm not sure whether Ghostscript came with OS X or if I installed it myself but it's freely available. Hope this helps, Stephen PS I am using the out-of-the-box R.app: platform powerpc-apple-darwin7.9.0 arch powerpc os darwin7.9.0 system powerpc, darwin7.9.0 status Patched major2 minor1.0 year 2005 month05 day 12 and Ghostscript 8.13 (2003-12-31) [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics on MacOSX
This is a big issue for me, causing many days of angst. I finally stumbled on the following solution. I create a device save an image with postscript(). I then open it in Adobe Acrobat, select the area I want, enlarge to at least 400%, then copy, then paste into PowerPoint or Word. Alternatively, you can simply save a graphics image through the gui and it saves it as pdf. Then go through the steps of selecting, enlarging and copying in Acrobat. I am guessing real graphics programs would work as well (Photoshop or Illustrator), but I don't have those. Hank Stevens On Aug 4, 2005, at 8:03 AM, Weismann_D wrote: Ist there a possibility on MacOSX to import Graphics into MSOffice Applications and resize them there without decreased quality? When I import via copypaste I get low quality bitmaps and via import pictures (pdf) it is all the same. In the Windows versions of R there is the convienient way to use metafile format which can easily be resized in ppt and word. What is the equivalent way on MacOSX? Thanks, Dirk. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Dr. Martin Henry H. Stevens, Assistant Professor 338 Pearson Hall Botany Department Miami University Oxford, OH 45056 Office: (513) 529-4206 Lab: (513) 529-4262 FAX: (513) 529-4243 http://www.cas.muohio.edu/botany/bot/henry.html http://www.muohio.edu/ecology/ http://www.muohio.edu/botany/ E Pluribus Unum __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics on MacOSX
Dear Dirk and Hank, On Aug 4, 2005, at 9:13 AM, Martin Henry H. Stevens wrote: This is a big issue for me, causing many days of angst. I finally stumbled on the following solution. I create a device save an image with postscript(). I then open it in Adobe Acrobat, select the area I want, enlarge to at least 400%, then copy, then paste into PowerPoint or Word. Alternatively, you can simply save a graphics image through the gui and it saves it as pdf. Then go through the steps of selecting, enlarging and copying in Acrobat. I am guessing real graphics programs would work as well (Photoshop or Illustrator), but I don't have those. Hank Stevens On Aug 4, 2005, at 8:03 AM, Weismann_D wrote: Ist there a possibility on MacOSX to import Graphics into MSOffice Applications and resize them there without decreased quality? When I import via copypaste I get low quality bitmaps and via import pictures (pdf) it is all the same. In the Windows versions of R there is the convienient way to use metafile format which can easily be resized in ppt and word. What is the equivalent way on MacOSX? Thanks, Dirk. You could try creating a PNG with bitmap() using a high resolution, e.g., bitmap(test.png, type = png256, res = 1200) plot(1:10, rnorm(10)) dev.off() Preview can read the resulting PNG file just fine and the Windows version of Office can insert PNGs, displays them well, and allows resizing. (I don't have an OS X version of Office so can't test that the OS X version would handle the PNGs equally well but I would have to assume it does.) bitmap() requires Ghostscript which I have installed on my system in /usr/local/bin. I'm not sure whether Ghostscript came with OS X or if I installed it myself but it's freely available. Hope this helps, Stephen PS I am using the out-of-the-box R.app: platform powerpc-apple-darwin7.9.0 arch powerpc os darwin7.9.0 system powerpc, darwin7.9.0 status Patched major2 minor1.0 year 2005 month05 day 12 and Ghostscript 8.13 (2003-12-31) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics: calling par(mar) after frame()
Brahm, David wrote: The following code produces 6 plots on a page, but the first is distorted and different from the others: par(mfrow=c(3,2), las=2) for (i in 1:6) { frame() par(mar=c(7, 7, 1, 1)) axis(2); box(); abline(h=seq(0,1,.5), col=2:4) } The first plot's axes are mis-aligned with the plotting area implied by the box. It seems to be a result of calling par(mar) after frame(). Is this expected behavior, or some kind of bug? Yes expected, at first yiou generate the plot, then you change the margins, and then you add stuff (axis). For the second plot, par(mar) has already been called in the first iteration. Why do you want to use it inside the loop? Uwe Ligges I'm using R-2.1.0 on Linux with X11; I see the same behavior in Windows. -- David Brahm ([EMAIL PROTECTED]) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics: calling par(mar) after frame()
I wrote: par(mfrow=c(3,2), las=2) for (i in 1:6) { frame() par(mar=c(7, 7, 1, 1)) axis(2); box(); abline(h=seq(0,1,.5), col=2:4) } The first plot's axes are mis-aligned with the plotting area... Uwe Ligges [EMAIL PROTECTED] replied: Yes expected, at first you generate the plot, then you change the margins, and then you add stuff (axis)... Why do you want to use it inside the loop? Thanks, Uwe, for making it clearer. My toy example puts these commands inside a loop because my real-life problem has them inside a function, which is called inside a loop. My function sets par(mar, usr, mgp). It seems I need to set par(mar) before frame(), par(usr) after frame(), and par(mgp) either before or after. I was not thinking of frame() as generating the plot so much as moving to the next location, so I didn't understand why the order mattered. Thanks again! -- David Brahm ([EMAIL PROTECTED]) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics file to disk
for example (works also with png and jpg) bmp(mypic.bmp); plot(...); dev.off(); hih __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Graphics file to disk
Hi Guy Try savePlot(MyPlot, bmp). Cheers Francisco PS: Hang in there! In the long run the effort to move from S-Plus to R is definitively worthy! From: Guy Forrester [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] Graphics file to disk Date: Thu, 12 May 2005 11:08:17 +1200 Dear All, I have some code that works in S-Plus for writing saving a graphics file to disk :- graphsheet(type = auto, format = WMF, file = G:\\north0l.wmf, pages = auto, print.background = F, orientation=landscape, color.style=color) plot(x,y) dev.off() This works fine in S-Plus. I have tried playing with the 'windows' command in `R' with out success. I would be grateful for any pointers in the right direction Many thanks in advance Guy Guy J Forrester Biometrician Manaaki Whenua - Landcare Research PO Box 69, Lincoln, New Zealand. Tel. +64 3 325 6701 x3738 Fax +64 3 325 2418 E-mail [EMAIL PROTECTED] www.LandcareResearch.co.nz WARNING: This email and any attachments may be confidential and/or privileged. They are intended for the addressee only and are not to be read, used, copied or disseminated by anyone receiving them in error. If you are not the intended recipient, please notify the sender by return email and delete this message and any attachments. The views expressed in this email are those of the sender and do not necessarily reflect the official views of Landcare Research. Landcare Research http://www.landcareresearch.co.nz [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE:[R] Graphics rile to disk
Many thanks to all who replied, In no particular order:- Tom Mulholland, Gunter Berton, Andrew Ward, Francisco Zagmutt, N. Olsen all is well Cheers Guy Guy J Forrester Biometrician Manaaki Whenua - Landcare Research PO Box 69, Lincoln, New Zealand. Tel. +64 3 325 6701 x3738 Fax +64 3 325 2418 E-mail [EMAIL PROTECTED] www.LandcareResearch.co.nz WARNING: This email and any attachments may be confidential and/or privileged. They are intended for the addressee only and are not to be read, used, copied or disseminated by anyone receiving them in error. If you are not the intended recipient, please notify the sender by return email and delete this message and any attachments. The views expressed in this email are those of the sender and do not necessarily reflect the official views of Landcare Research. Landcare Research http://www.landcareresearch.co.nz [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics file to disk
If you want to write directly to file, ?Devices will get you more information Guy Forrester wrote on 5/11/2005 7:08 PM: Dear All, I have some code that works in S-Plus for writing saving a graphics file to disk :- [...] -- Michael H. Prager, Ph.D. Population Dynamics Team NOAA Center for Coastal Habitat and Fisheries Research NMFS Southeast Fisheries Science Center Beaufort, North Carolina 28516 USA http://shrimp.ccfhrb.noaa.gov/~mprager/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Graphics (for goodness of fit) Question
In regards to your plot question, you could use points() or lines(): a - sample(1:50,10) b - sample(20:40,10) plot(1:10,a,pch=20,col=red) points(1:10,b,pch=20,col=blue) #or #lines(1:10,b,pch=20,col=blue,type=o) -Original Message- From: Mohammad Ehsanul Karim [mailto:[EMAIL PROTECTED] Sent: Sunday, March 20, 2005 10:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Graphics (for goodness of fit) Question Dear List, Suppose, I have some observed and expected frequencies, such as following. I need to draw a graph where plots of observed and expected frequencies are merged into one. m - c(1,2,3,4,5,6,7,8,9,10,12,13,17) k - c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19) ExpWW - c(0.309330628803245, 0.213645190887434, 0.147558189649435, 0.101913922060107, 0.0703888244654489, 0.0486154051328303, 0.0335771712935674, 0.0231907237838939, 0.0160171226134196, 0.0110625360037919, 0.00764055478558038, 0.00527709716935116, 0.000395627498345897) ExpDD - c(0.420249653259362, 0.243639882194748, 0.141250306182253, 0.0818899139863827, 0.0474757060281664, 0.0275240570315860, 0.0159570816077711, 0.00925112359507395, 0.00536334211198462, 0.00310939944911175, 0.00104510169329968, 0.00060589806906972, 6.84484529305126e-05) ObjDD - c(0.468646864686469, 0.198019801980198, 0.151815181518152, 0.0759075907590759, 0.0396039603960396, 0.0198019801980198, 0.0165016501650165, 0.0099009900990099, 0.0033003300330033, 0.0033003300330033, 0.0033003300330033, 0.0066006600660066, 0.0033003300330033) ObjWW - c(0.373770491803279, 0.150819672131148, 0.127868852459016, 0.0721311475409836, 0.0885245901639344, 0.0622950819672131, 0.039344262295082, 0.0327868852459016, 0.0360655737704918, 0.00327868852459016, 0.00655737704918033, 0.00327868852459016, 0.00327868852459016) par(mfrow=c(2,2)) plot(k,ObjWW, type=l) # Plot 1 plot(k,ExpWW, type=l) # Plot 2 plot(m,ObjDD, type=l) # Plot 3 plot(m,ExpDD, type=l) # Plot 4 # I need to see plot 1 and 2 in same axis, and plot 3 and 4 in another # (i.e., 3, 4 both in same axis too, but not with 1 and 2's). # How can i use different types of legends in the same graph?? sum(((ObjWW-ExpWW)^2)/ExpWW) # Chi-Squared Goodness of Fit Test sum(((ObjDD-ExpDD)^2)/ExpDD) # Chi-Squared Goodness of Fit Test # Also, is there any other convenient way of doing chi-squared goodness of fit test (any function or package may be, to do this directly)? # And how can i find the P-values of the respective chi-squared tests in R? Any suggestion, direction, references, help, replies will be highly appreciated. Thank you for your time. Mohammad Ehsanul Karim Web: http://snipurl.com/ehsan Institute of Statistical Reseach and Training University of Dhaka, Dhaka - 1000, Bangladesh __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
John Dougherty jwd at surewest.net writes: On Thursday 24 February 2005 04:13, Adrian Dusa wrote: ... You need to check your font installation. Be sure the X-11 fonts are installed. XFree86-fonts-75dpi-4.3.99.902-30 XFree86-fonts-100dpi-4.3.99.902-30 Should both be on your system. If they aren't bring up the YaST control center and select Install and Remove Software. You can use the search option to filter for packages that have fonts in their descritpion. Install any that aren't. SuSE seems to be a little funny about the X-11 fonts. Peter Dalgaard just let me know about that a short time ago. Thank you for the info; I found that thread as well, but I seem to have both 75 and 100 dpi packages installed: xorg-x11-fonts-100dpi version 6.8.1-15 xorg-x11-fonts-75dpi version 6.8.1-15 Googling around, I wasn't able to find any XFree86 .rpm fonts package. I am also playing with the UTF-8 locales, it may have something to do with this. JWDougherty __ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Regards, Adrian __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
Adrian, That was my fault. I have the xorg fonts. Peter pointed out the changes and I found that the 100dpi fonts were not installed. Doing so fixed my problem. John __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
Prof Brian Ripley ripley at stats.ox.ac.uk writes: On Tue, 22 Feb 2005 Cedric.Ginestet at tvu.ac.uk wrote: The R platform that I installed on my Windows XP crashes everytime that I try to run some sophisticated graphics (e.g. Demo Graphics). Is that to do with the configuration? Shall I reinstall it? Please consult the rw-FAQ. It is likely to be a problem with your Windows installation, as R runs on literally thousands (maybe tens of thousands) of Windows XP machines. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html which points you at the rw-FAQ. I have a similar problem; I am sure there's something I should do on my machine but I just can not figure out what. On: demo(graphics) after two enters, I get: title(main = January Pie Sales, cex.main = 1.8, font.main = 1) Error in title(main = January Pie Sales, cex.main = 1.8, font.main = 1) : X11 font at size 22 could not be loaded I read the R Installation and Administration manual, I recompiled R using all the options (e.g. --with-x), I have all the requred packages... My system: SuSE 9.2 Professional version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major2 minor0.1 year 2004 month11 day 15 language R Any hint would be highly appreciated, Adrian __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
On Thu, 24 Feb 2005, Adrian Dusa wrote: Prof Brian Ripley ripley at stats.ox.ac.uk writes: On Tue, 22 Feb 2005 Cedric.Ginestet at tvu.ac.uk wrote: The R platform that I installed on my Windows XP crashes everytime that I try to run some sophisticated graphics (e.g. Demo Graphics). Is that to do with the configuration? Shall I reinstall it? Please consult the rw-FAQ. It is likely to be a problem with your Windows installation, as R runs on literally thousands (maybe tens of thousands) of Windows XP machines. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html which points you at the rw-FAQ. I have a similar problem; I am sure there's something I should do on my machine but I just can not figure out what. Excuse me: you are not on Windows XP and your R is *not* crashing (see the posting guide). So in what way is the problem similar? My advice you quote is not pertinent to your problem. On: demo(graphics) after two enters, I get: title(main = January Pie Sales, cex.main = 1.8, font.main = 1) Error in title(main = January Pie Sales, cex.main = 1.8, font.main = 1) : X11 font at size 22 could not be loaded I read the R Installation and Administration manual, I recompiled R using all the options (e.g. --with-x), I have all the requred packages... This is a problem with your X configuration, not with R. My system: SuSE 9.2 Professional version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major2 minor0.1 year 2004 month11 day 15 language R Any hint would be highly appreciated, -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
On Thursday 24 February 2005 04:13, Adrian Dusa wrote: ... You need to check your font installation. Be sure the X-11 fonts are installed. XFree86-fonts-75dpi-4.3.99.902-30 XFree86-fonts-100dpi-4.3.99.902-30 Should both be on your system. If they aren't bring up the YaST control center and select Install and Remove Software. You can use the search option to filter for packages that have fonts in their descritpion. Install any that aren't. SuSE seems to be a little funny about the X-11 fonts. Peter Dalgaard just let me know about that a short time ago. JWDougherty __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
On Tue, 22 Feb 2005 16:50:51 -, [EMAIL PROTECTED] wrote : Hi, The R platform that I installed on my Windows XP crashes everytime that I try to run some sophisticated graphics (e.g. Demo Graphics). Is that to do with the configuration? Shall I reinstall it? You should say what version you installed, and give the command that crashes it, but I would say there is definitely something wrong with your system or your install, because it certainly doesn't crash for most people. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphics
On Tue, 22 Feb 2005 [EMAIL PROTECTED] wrote: The R platform that I installed on my Windows XP crashes everytime that I try to run some sophisticated graphics (e.g. Demo Graphics). Is that to do with the configuration? Shall I reinstall it? Please consult the rw-FAQ. It is likely to be a problem with your Windows installation, as R runs on literally thousands (maybe tens of thousands) of Windows XP machines. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html which points you at the rw-FAQ. -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics - current filename
On Mon, 14 Feb 2005, Uwe Ligges wrote: Paul Sorenson wrote: I would like to query R for the current (or last used) filename for a graphics device. Eg after png(filename=plot%02d.png) I would like something like the output of dev.cur() but with the %02d expanded to the current name. You cannot, it is handled internally and the name is not returned. So you have to workaround yourself either by specifying filenames yourself and looping over the png() calls, or counting yourself ... Or just look on the disk with list.files(). sort(list.files(pattern=plot[0-9][0-9]\\.png), decreasing=TRUE)[1] -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics - current filename
On Mon, Feb 14, 2005 at 07:23:23AM -0800, Thomas Lumley wrote: On Mon, 14 Feb 2005, Uwe Ligges wrote: Paul Sorenson wrote: I would like to query R for the current (or last used) filename for a graphics device. Eg after png(filename=plot%02d.png) I would like something like the output of dev.cur() but with the %02d expanded to the current name. You cannot, it is handled internally and the name is not returned. So you have to workaround yourself either by specifying filenames yourself and looping over the png() calls, or counting yourself ... Or just look on the disk with list.files(). sort(list.files(pattern=plot[0-9][0-9]\\.png), decreasing=TRUE)[1] As a note of caution: Don't use this technique if you intend to run your program more than once (unless you arrange for your program to remove any preexisting plot[0-9][0-9].png files before entering into the loop in question, which may also prove undesired some day down the line...). Otherwise, if you e.g. repeat the same thing that produces files plot01.png to plot99.png, the first run will work as intended, but the second run will deal with plot99.png in each cycle of the loop... The idea of querying the device for the current file name is basically correct, because the device would be the authorive source of that information, but as that isn't available, I'd second the recommendation to specifying the file names yourself. Then, you are the authoritative source. Kind regards, Jan -- +- Jan T. Kim ---+ |*NEW*email: [EMAIL PROTECTED] | |*NEW*WWW: http://www.cmp.uea.ac.uk/people/jtk | *-= hierarchical systems are for files, not for humans =-* __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics - current filename
Paul Sorenson wrote: I would like to query R for the current (or last used) filename for a graphics device. Eg after png(filename=plot%02d.png) I would like something like the output of dev.cur() but with the %02d expanded to the current name. You cannot, it is handled internally and the name is not returned. So you have to workaround yourself either by specifying filenames yourself and looping over the png() calls, or counting yourself ... Uwe Ligges Can anyone point me at where I can find this please? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] graphics examples
Very nice! I can't wait to buy the book. I have some plots I am working on that are surprisingly difficult to do : http://www.oplnk.net/~ajackson/weather/Temperature_2000.png and others in that directory for an example. The challenge was coloring in the polygons which were, in some cases, defined by the intersection of four curves, and also required interpolating the bounding curves to those intersection points. I'll post the code on the website tonight. Alan Jackson Staff Geophysicist Shell International Exploration and Production Inc. 3737 Bellaire Blvd, P O Box 481, Houston, Texas 77001-0481, USA Tel: +0117132457355 none Other Tel: +011-713-245-7355 Email: [EMAIL PROTECTED] Internet: http://www.shell.com/eandp-en -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, February 03, 2005 8:35 PM To: r-help@stat.math.ethz.ch Subject: [R] graphics examples Hi I have put up some web pages containing a number of plots (and diagrams) produced using R (they correspond to the figures for a book that I am working on about R graphics), with the relevant R code provided for each plot (or diagram), at http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html Hope these are of some help/use; comments/suggestions welcome. Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics
Dear Jim, many thanks for your reply and support. It seems to be that with your help I could solve my problem with the plotting of the data. The only thing that does not work is to see the coloured lines, maybe because of the crowd of curves. With the density of curves I ment to distinguish in the confidence interval between areas, where a lot of curves (lines) are located, and areas having a lower density of lines. In other words, I would like to show the area, where 100 % of the lines are included, then the area, where 90 % are included, and so forth with the other quantiles, but with a steady change of colours, and not by a stepwise change (if posible). Many thanks again, Fred Jim Lemon wrote: Fred Hattermann wrote: Dear R-user, I am a R beginner, and therefore my questions are very basic. I have a simple problem: I would like to plot 100 time series each containing 55 steps. The data are stored in a matrix of 100 columns and 55 rows. The first problem is to load the data from a file: I tried the read.table(), the scan() and the matrix(scan()) options, but I have problems to allocate the single columns. The list() option could be a solution, but it is very unconvenient: list(0,0,0..). # generate some random numbers testts.df-data.frame(matrix(rnorm(5500)/5,nrow=55)) # superimpose them on a sine curve newts-sapply(testts.df,function(x) return(x+sin(seq(0,pi*2,length=55 # make it a time series newts-as.ts(newts) # write out the data write.table(newts,newts.dat) # read it in again newts-as.ts(read.table(newts.dat)) And how do I plot a single time series, let's say the 50s? And how to plot all of them? # plot the first one plot(newts[,1],ylim=range(newts)) # add the other 99 lines - probably pretty messy! for(i in 2:100) lines(newts[,i]) The last problem is maybe more advanced: I would like to plot all 100 time series, but with a confidence interval, where the density of data is indicated by the density of the colour of the confidence interval. # get the means of the observation points newts.means-apply(as.matrix(newts),1,mean) # calculate a CI - probably not the one you want newts.ci-1.96*sapply(as.matrix(newts),sd) # plot the CI lines(newts.means+newts.ci,col=red) lines(newts.means-newts.ci,col=green) I'm not sure what you mean by the density of the curve, so I can't suggest anything. However, I am adding a function named color.scale to the next version of the plotrix package, so I'll email you when I put it up on CRAN. Jim -- *** * Potsdam Institute for Climate Impact Research (PIK) * * Telegrafenberg C 4 D-14473 Potsdam * * PO box: 60 12 03 D-14412 Potsdam* * Tel.: (0331) 288 - 2649* * Fax: (0331) 288 - 2695* * e-mail: [EMAIL PROTECTED] * *** __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics
Fred Hattermann wrote: Dear R-user, I am a R beginner, and therefore my questions are very basic. I have a simple problem: I would like to plot 100 time series each containing 55 steps. The data are stored in a matrix of 100 columns and 55 rows. The first problem is to load the data from a file: I tried the read.table(), the scan() and the matrix(scan()) options, but I have problems to allocate the single columns. The list() option could be a solution, but it is very unconvenient: list(0,0,0..). And how do I plot a single time series, let's say the 50s? And how to plot all of them? These questions are really basic, they are covered in the manuals and any good book about R. Please read at least a) the manual An Introduction to R b) the manual R Data Import/Export c) the posting guide (see below, has been appended at the end of your message) After you have read through and tried to solve your problem again, you might want to come up with a specific question again. The last problem is maybe more advanced: I would like to plot all 100 time series, but with a confidence interval, where the density of data is indicated by the density of the colour of the confidence interval. A colleague gave me the tip that this is possible in R2.0 and described in the newest newsletter ... This question is also unspecific. Which kind of confidence interval? What does density of data mean here? Do you mean a global quantity for the whole series or really the empirical (estimated) density so that color changes from point to point? Uwe Ligges Many thanks in advanced, Fred __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics site
On Fri, 5 Nov 2004, Pierre BADY wrote: hi, you can see these links: http://pbil.univ-lyon1.fr/R/enseignement.html http://zoonek2.free.fr/UNIX/48_R/all.html http://www.ceremade.dauphine.fr/~xian/Noise.html http://statwww.epfl.ch/davison/teaching/ProbStat/20032004/PDF http://www.ulb.ac.be/di/map/gbonte/mod_stoch Wow! Any translations / equivelents of these resources? I also find ... http://www.stat.wisc.edu/~deepayan/SIBS/otopics/base-graphics.html Which has an exelent series of images (in a PDF) linked to source code on the site. Any site designed like a decision tree (classification of R graphics) with images to click until you find the graphics you want? perhaps the site you a looking for is here ... ;o)) hope this helps P.BADY At 09:24 05/11/2004 -0600, Michaell Taylor wrote: About six months ago there was a reference to a site (in french) that did a spectacular job of demonstrating R's graphical capabilities. My bookmarks were recently wiped and I cannot find this site despite my best googling. Anyone have the address which I have done a miserable job describing? Thanks. Michaell __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Pierre BADY °) Université Claude Bernard Lyon 1 UMR CNRS 5023, LEHF bat Alphonse Forel 43 boulevard du 11 novembre 1918 F-69622 VILLEURBANNE CEDEX FRANCE TEL : +33 (0)4 72 44 62 34 FAX : +33 (0)4 72 43 28 92 MEL : [EMAIL PROTECTED] http://limnologie.univ-lyon1.fr [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics site
Michaell Taylor Michaell.Taylor at boxwoodmeans.com writes: : : About six months ago there was a reference to a site (in french) that : did a spectacular job of demonstrating R's graphical capabilities. : : My bookmarks were recently wiped and I cannot find this site despite my : best googling. : : Anyone have the address which I have done a miserable job describing? : : Thanks. : : Michaell Try a google search for zoonekynd . __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics site
hi, you can see these links: http://pbil.univ-lyon1.fr/R/enseignement.html http://zoonek2.free.fr/UNIX/48_R/all.html http://www.ceremade.dauphine.fr/~xian/Noise.html http://statwww.epfl.ch/davison/teaching/ProbStat/20032004/PDF http://www.ulb.ac.be/di/map/gbonte/mod_stoch perhaps the site you a looking for is here ... ;o)) hope this helps P.BADY At 09:24 05/11/2004 -0600, Michaell Taylor wrote: About six months ago there was a reference to a site (in french) that did a spectacular job of demonstrating R's graphical capabilities. My bookmarks were recently wiped and I cannot find this site despite my best googling. Anyone have the address which I have done a miserable job describing? Thanks. Michaell __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Pierre BADY °) Université Claude Bernard Lyon 1 UMR CNRS 5023, LEHF bat Alphonse Forel 43 boulevard du 11 novembre 1918 F-69622 VILLEURBANNE CEDEX FRANCE TEL : +33 (0)4 72 44 62 34 FAX : +33 (0)4 72 43 28 92 MEL : [EMAIL PROTECTED] http://limnologie.univ-lyon1.fr [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Graphics in BATCH CMD mode
See ?bitmap. Andy From: Moises Hassan Running R scripts via 'R_exe BATCH CMD inpufile outputfile' works fine with jpeg commands in Windows, but the jpeg commands give an error under Linux because GUI is set to none. Is there a way to use jpeg commands in BATCH CMD in Linux. Thanks, Moises __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics device problems
David Parkhurst wrote: I'm using R 1.8.0 under windows XP. I can't get certain of the graphics devices set up. For example, when I copy this line directly from the postscript help screen, I get the error messages that follow it: postscript(foo.ps) Error in PS(file, old$paper, old$family, old$encoding, old$bg, old$fg, : unable to start device PostScript In addition: Warning message: cannot read afm file hvo_.afm I have a similar problem with the pdf device (which I think is my preferred device for my present job): pdf(myfile.pdf) Error in PDF(file, old$family, old$encoding, old$bg, old$fg, width, height, : unable to start device pdf In addition: Warning message: cannot read afm file hvo_.afm Any suggestions would be welcome. Looks like your installation is broken. Does the file ...\rw1080\afm\hvo_.afm exist? If yes, do you have read permissions? You might want to re-install R. Also, it's a good idea to upgrade to R-1.8.1, because R-1.8.0 is a bit buggy on Windows ... Uwe Ligges Dave Parkhurst [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] graphics reset
On Sun, 16 Nov 2003 17:19:29 -0500, you wrote: Hello, Is there a specific command to clear the graphics window. On occasion I need to construct plots using commands that don't clear the graphics window (like text, lines and points etc.) -only- and hence need to clear the graphics completely before hand. frame() or plot.new() will move to the next frame. By default, there's only one frame, but calls like par(mfrow=c(2,2)) set up more frames on a single page. also, is there a way to restore the graphics parameters to default values, say in these cases where you forgot to save the original values and want to restore the graphics to some sane state after a long R session. The easiest way is to use dev.off() to close the graphics window and then start plotting to open a fresh new one, with default settings. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
Christoph Bier schrieb: [...] Yes, it is, thanks! But it seems only to work with arrays as No, it also works with data.frames as help(colSums) told me. -- Christoph Bier, Dipl.Oecotroph., Email: [EMAIL PROTECTED] Universitaet Kassel, FG Oekologische Lebensmittelqualitaet und Ernaehrungskultur \\ Postfach 12 52 \\ 37202 Witzenhausen Tel.: +49 (0) 55 42 / 98 -17 21, Fax: -17 13 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
On Tue, 21 Oct 2003, Christoph Bier wrote: Hi, is there an graphics overview, where the graphic capabitlities of R are shown with the corresponding code? I already tested 'demo(graphics)', that isn't that comprehensive, 'demo(image)', 'demo(lattice)', searched the Mailarchive, googled and the FAQ keeps silent, too. For example, I know how a special graphic I need should look like, but I don't know how to realise it. I even don't know how to describe it =). Chapter 4 of MASS (the book) is a pretty comprehensive set of examples, but given that there are lots of plots associated with e.g. multivariate analysis (try chapter 11 of MASS) and time series (try chapter 14 of MASS) the scope is enormous. Another example, much more simpler (I hope): I want to get the sum of the values in a plot above the columns. Like this: | 3 | 2_ | _ | | | | | | | |_|_|__|_|__ AB RTMFs are welcome =/. But I read 'help(plot)' (plot is what I actually use for the graphic above¹) and 'help(par)', It looks like a barplot to me. searched my introduction to S and S-Plus and I'm still waiting for Introductory Statistics with R (P. Dalgaard), that is not deliverable at the moment. There is an example of that in the MASS package script ch04.R The means to do it are described in `An Introduction to R' (and elsewhere). -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
On 10/21/03 12:22, Christoph Bier wrote: Hi, is there an graphics overview, where the graphic capabitlities of R are shown with the corresponding code? A very elementary overview like this is in our Notes on R for psychology experiments and questionnaires, in CRAN contributed documents and in my R page below. We expanded it a bit from the even-more elementary version that was there before August. -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page:http://www.sas.upenn.edu/~baron R page: http://finzi.psych.upenn.edu/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
Prof Brian Ripley wrote: Chapter 4 of MASS (the book) is a pretty comprehensive set of examples, but given that there are lots of plots associated with e.g. multivariate analysis (try chapter 11 of MASS) and time series (try chapter 14 of MASS) the scope is enormous. I ordered it right now in our library. Another example, much more simpler (I hope): I want to get the sum of the values in a plot above the columns. Like this: | 3 | 2_ | _ | | | | | | | |_|_|__|_|__ AB RTMFs are welcome =/. But I read 'help(plot)' (plot is what I actually use for the graphic above¹) and 'help(par)', It looks like a barplot to me. It's realised (without the sum of the values above the coliumns) via attach(data.frame) plot(variable.from.data.frame) ... searched my introduction to S and S-Plus and I'm still waiting for Introductory Statistics with R (P. Dalgaard), that is not deliverable at the moment. There is an example of that in the MASS package script ch04.R The means to do it are described in `An Introduction to R' (and elsewhere). I had a look at this script on my machine and have a print version of An Introduction to R. Maybe I find out what to do with such scripts. Thanks for your answer! Best regards, Christoph -- Christoph Bier, Dipl.Oecotroph., Email: [EMAIL PROTECTED] Universitaet Kassel, FG Oekologische Lebensmittelqualitaet und Ernaehrungskultur \\ Postfach 12 52 \\ 37202 Witzenhausen Tel.: +49 (0) 55 42 / 98 -17 21, Fax: -17 13 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
Prof Brian Ripley [EMAIL PROTECTED] writes: On Tue, 21 Oct 2003, Christoph Bier wrote: Hi, is there an graphics overview, where the graphic capabitlities of R are shown with the corresponding code? I already tested 'demo(graphics)', that isn't that comprehensive, 'demo(image)', 'demo(lattice)', searched the Mailarchive, googled and the FAQ keeps silent, too. For example, I know how a special graphic I need should look like, but I don't know how to realise it. I even don't know how to describe it =). Chapter 4 of MASS (the book) is a pretty comprehensive set of examples, but given that there are lots of plots associated with e.g. multivariate analysis (try chapter 11 of MASS) and time series (try chapter 14 of MASS) the scope is enormous. Another example, much more simpler (I hope): I want to get the sum of the values in a plot above the columns. Like this: | 3 | 2_ | _ | | | | | | | |_|_|__|_|__ AB RTMFs are welcome =/. But I read 'help(plot)' (plot is what I actually use for the graphic above¹) and 'help(par)', (Read the muckin' *what*?? ;-) ) It looks like a barplot to me. searched my introduction to S and S-Plus and I'm still waiting for Introductory Statistics with R (P. Dalgaard), that is not deliverable at the moment. That book tries rather hard to show only the basic procedure and not to do fancy things, so this is not explicitly covered in there. It does describe barplot() and text(), though. (Odd, BTW, www.springer.de says it ships within 3 days). There is an example of that in the MASS package script ch04.R The means to do it are described in `An Introduction to R' (and elsewhere). Also, try par(ask=T); example(barplot) The fourth example is fairly close to what you want to do (colSums instead of colMeans should place the numbers at the end of the columns). -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
Jonathan Baron schrieb: On 10/21/03 12:22, Christoph Bier wrote: Hi, is there an graphics overview, where the graphic capabitlities of R are shown with the corresponding code? A very elementary overview like this is in our Notes on R for psychology experiments and questionnaires, in CRAN contributed documents and in my R page below. We expanded it a bit from the even-more elementary version that was there before August. I can't find any graphics neither in the document nor on your webpage. Maybe a missunderstanding what I'm looking for. Thanks anyway! Best regards, Christoph -- Christoph Bier, Dipl.Oecotroph., Email: [EMAIL PROTECTED] Universitaet Kassel, FG Oekologische Lebensmittelqualitaet und Ernaehrungskultur \\ Postfach 12 52 \\ 37202 Witzenhausen Tel.: +49 (0) 55 42 / 98 -17 21, Fax: -17 13 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
Peter Dalgaard wrote: On Tue, 21 Oct 2003, Christoph Bier wrote: [...] RTMFs are welcome =/. But I read 'help(plot)' (plot is what I actually use for the graphic above¹) and 'help(par)', (Read the muckin' *what*?? ;-) ) Oops :-D [...] (Odd, BTW, www.springer.de says it ships within 3 days). And our local book store said, that it's not deliverable. So my colleague tried www.amazon.de, that says it ships within 11--12 days. We are still waiting ... par(ask=T); example(barplot) Nice! The fourth example is fairly close to what you want to do (colSums instead of colMeans should place the numbers at the end of the columns). Yes, it is, thanks! But it seems only to work with arrays as VADeaths. I don't have an array but a data.frame. And mainly I'm a naive newbie, that gets more confused the more he wants from R =(. Best regards, Christoph -- Christoph Bier, Dipl.Oecotroph., Email: [EMAIL PROTECTED] Universitaet Kassel, FG Oekologische Lebensmittelqualitaet und Ernaehrungskultur \\ Postfach 12 52 \\ 37202 Witzenhausen Tel.: +49 (0) 55 42 / 98 -17 21, Fax: -17 13 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Graphics overview
On 10/21/03 14:38, Christoph Bier wrote: Jonathan Baron schrieb: A very elementary overview like this is in our Notes on R for psychology experiments and questionnaires, in CRAN contributed documents and in my R page below. We expanded it a bit from the even-more elementary version that was there before August. I can't find any graphics neither in the document nor on your webpage. Maybe a missunderstanding what I'm looking for. Perhaps. I'm sorry. I was referring to the chapter on graphics. Specifically http://www.psych.upenn.edu/~baron/rpsych/rpsych.html#SECTION0006 Although this isn't what you wanted, it might be useful to someone else who wants a graphics overview (the title of your post). Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page:http://www.sas.upenn.edu/~baron R page: http://finzi.psych.upenn.edu/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] graphics device
Brunschwig, Hadassa {PDMM~Basel} wrote: Hi all, well i know this was probably already posted many times, couldnt find anything about it though. This is a beginner problem. I have a Trellis plot which is very large, i.e. it only shows me the last few panels (after going automatically through the first ones and stopping at the last few). When i scrole with PageUp or Page down it shows me the panels of a graph i did last time but not of the graph i plotted now. I also tried to use the dev.next() etc. functions but the showing doesnt change. I guess i dont really understand how these functions work but i would like to print the whole set of panels. Thanks for reply Dassy I'd recommend to generate PostScript or PDF output at first, then you get a document you can scroll through and printing won't be a problem. Uwe Ligges __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] graphics device
On Thursday 21 August 2003 05:04, Uwe Ligges wrote: Brunschwig, Hadassa {PDMM~Basel} wrote: Hi all, well i know this was probably already posted many times, couldnt find anything about it though. This is a beginner problem. I have a Trellis plot which is very large, i.e. it only shows me the last few panels (after going automatically through the first ones and stopping at the last few). When i scrole with PageUp or Page down it shows me the panels of a graph i did last time but not of the graph i plotted now. I also tried to use the dev.next() etc. functions but the showing doesnt change. I guess i dont really understand how these functions work but i would like to print the whole set of panels. Thanks for reply Dassy I'd recommend to generate PostScript or PDF output at first, then you get a document you can scroll through and printing won't be a problem. Uwe Ligges Also, you could set par(ask = TRUE), which will prompt you before each new page. Deepayan __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] graphics backgrounds from gray to white in png()
You need to change the (lattice) background setting AFTER starting the png() device (lattice maintains separate settings for different devices). If you use png() to start subsequent devices, the same settings will be re-used. (The alternative is to use trellis.device(), which is the more traditional but not-really-necessary-in-lattice way, in which case by default the settings will revert back to the grey background every time a new device is started.) On Monday 10 March 2003 11:48 am, Scot W McNary wrote: Hi, I'm trying to make a png file of a histogram. I would like a white background in the final product but end up producing a gray one, despite setting what I think are the correct parameters. Suggestions for how to properly set a white background would be welcome. Thanks in advance, Scot # for non-lattice par(bg=white) par(bg) [1] white # for lattice background-trellis.par.get(background) background$col-white trellis.par.set(background,background) trellis.par.get(background) $col [1] white # produces gray background in png, but white when plotted in active device png(filename = c:/windows/temp/test.png, width=480, height=640, + pointsize = 10, bg=white) histogram(rnorm(500)) dev.off() windows 2 Vitals: R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor6.2 year 2003 month01 day 10 language R -- Scot W. McNary email:[EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] graphics landscape orientation
That's a function of the R graphics driver, e.g. the horizontal arg in postscript() or set a landscape format width and height in pdf() or win.metafile() or On Tue, 14 Jan 2003, Juan Ramon Gonzalez wrote: I would like to know how I can get the resulting graphic of the function plot.hclust (from the package cluster) in landscape orientation. Is it possible? -- 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 __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help