[R-SIG-Mac] summary: MacOSX, Panther; save graphs, jpg(), pdf(), bitmap(), Ghostscript, X11 server

Jan de Leeuw deleeuw at stat.ucla.edu
Thu Dec 9 18:36:44 CET 2004

Don't forget command-shift-4, which allows you to save any rectangular  
portion of the screen to
a png file. Since it's on the keyboard it's fast, and it's flexible.  
Works with both X11 and Quartz
devices, and can easily be used from CLI, ESS and Aqua interfaces to R.

On Dec 9, 2004, at 8:58 AM, Tiago R Magalhaes wrote:

> So after taking some time and bothering some people (Thanks very much  
> to all of them: Simon Urbanek, Rob J Goedman, Stefano Iacus, Byron  
> Ellis, Elijah Wright, Denis Chabot, Nathan Weisz) I solved the  
> problem.
> I decided to write this summary. It's kind of long, but it might be  
> helpeful to someone else.
> Two problems: installation and knowledge on how to use R. This is  
> valid for Panther 10.3.6, R 2.01 in a PowerBookG4.
> I) Installation
> X11 server has to be running. Go to Misc, Run X11 Server. You have to  
> have X11 installed in your computer. Some Macs don't have it  
> installed. It's on the 3rd CD. You can also download it from:  
> http://www.apple.com/macosx/features/x11/download/
> 2) Saving graphs:
> jpeg(), png(), pdf()
> a) You have to have X11 running. Go to Misc, RunX11 server, let X11  
> opened, don't close it.
> b)to save a file you first have to open a device.
> this was confusing to me, so let me be clear for other people like  
> myself (supposing I am not the only one having this problem...).
> jpeg() and png() pdf() are NOT used to save plots AFTER the plots are  
> done. That's not what they do.
> example:
> jpeg("myfile.jpg")  #opens a device - saves a file in your directory  
> but it has 0 Kb
> plot(1:10)  #places the plot in the device - still 0 Kb file in your  
> directory
> dev.off() #closes the device and saves the contents of the plot in  
> file.
>  #you now have a file
> 3) there is another way to save graphs:
> bitmap()
> for that you need to have Ghostscript installed. I dowloaded  
> Ghostscript, but using bitmap() sill does't work, it still can't find  
> Ghostscript, I don't know where I have to install it, but I don't  
> really need it.
> General considerations:
> a) It's always possible to save pdfs files from the active device on  
> the menu: file > save
> b) cut and paste also works
> c) pdfs are wonderful for graphs and lines. I was surprised by the  
> quality and the small size of the file. Another show of my ignorance.
> d) I am very surprised that this has not been an issue. I think the  
> functions are not very intuitive and the help pages, although clear  
> NOW, didn't help me that much when I first read them.
> e) I'm curious about this on windows. Do they also go through this  
> device process?
> f) you people are wonderful. Thanks for all the support and the help  
> that I have had. It was a little time consuming but I've learned a lot  
> in the process.
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of  
Editor: Journal of Multivariate Analysis, Journal of Statistical  
US mail: 8130 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550; fax (310)-206-5658; email: deleeuw at stat.ucla.edu
homepage: http://gifi.stat.ucla.edu
  No matter where you go, there you are. --- Buckaroo Banzai

More information about the R-SIG-Mac mailing list