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

Rob J Goedman goedman at mac.com
Thu Dec 9 19:13:37 CET 2004


Thanks for the summary Tiago.

X11 is only needed for jpeg and png. I would take Stefano's advice, use 
pdf and use Apple's
previewer to export in many different formats.

In this case it is unfortunate 'example(pdf)' does not create a small 
example file.

Rob

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



More information about the R-SIG-Mac mailing list