[R-SIG-Mac] saving graphs; jpeg(), bitmap()

stefano iacus stefano.iacus at unimi.it
Thu Dec 9 01:05:29 CET 2004

On Dec 9, 2004, at 1:00 AM, Simon Urbanek wrote:

> Hi Tiago,
> On Dec 8, 2004, at 5:50 PM, Tiago R Magalhaes wrote:
>> I want to export some plots. I have looked in the documentation and 
>> in the R-help archives. 2 main functions jpeg(), bitmap() are used, 
>> but I can't save any plots using them. (error logs at the end of the 
>> email). I'm using a PowerBook G4, Panther 10.3, R.2.1.
>> a) when using jpeg() I seem to be missing the X11 server. I have X11 
>> on my computer and it works fine. (XDarwin 1.3b4). On the R menu, 
>> under Miscillaneous there is a Run X11 server. When I lauch it 
>> reports an error: "2004-12-08 22:24:13.082 open[10513] Couldn't 
>> launch application: X11.app"
> Um... why do you use XDarwin instead of the supported Apple X11 which 
> comes with Mac OS X? The GUI (i.e. that button) is designed to work 
> with Apple's X11, because it's the official standard (you don't even 
> have to download it..). Last time I saw XDarwin its WM were much less 
> well integrated that quartz-wm...

Tiago, Simon is right. You should probably use Apple X11 or set the 
DISPLAY var on your own.

> You can still use XDarwin if you feel like it, but in any case make 
> sure your DISPLAY is set - if in doubt, type
> Sys.setenv(DISPLAY=":0.0")
> in R before using those graphics devices.
>> b) for using bitmap() I don't have the ghostscript file. Is it a mac 
>> file? Should I get it from somewhere?
> gs is basically a program running on most platforms, including Mac - 
> if you use TeX then you should have gs already installed (or you can 
> get it via i-Installer along with the TeX stuff).
>> d) and this is really just curiosity. The pdf file exported via menu 
>> is small (16kb) but when I open it in Photoshop and tell it to be 
>> 300dpi becomes a big file (14Mb) and the quality is very good! I 
>> imagine this to be related to vectors instead of dots. I googled the 
>> terms, but there's nothing that mention pdfs as good grahp formats (I 
>> didn't do an extensive search, there were MANY documents, even trying 
>> to be very stringent)
> PDF is actually a very good format supporting both bitmap (cf 
> PhotoShop) and vector graphics (cf Illustrator) - it's even better 
> than old PostScript, because it supports transparency and other cool 
> things. Mac OS X actually uses PDF as its main display format. In fact 
> PS used to be the standard for publishing and nowadays PDF is 
> replacing that role. As a Mac user you're in the fortunate position of 
> having many good PDF tools at your fingertips (in contrast to the Win 
> folks :P).

well, let me say that the PDF file saved via R menus on mac, makes a 
copy of the current graphic device (quartz) on the R pdf() device. It's 
order of magnitude smaller that what you get by using quartz (but don't 
ask me why, I simply don't have to check at the moment).

> Cheers,
> Simon
> _______________________________________________
> 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