saving graphs; jpeg(), bitmap()
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... 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). Cheers, Simon