[R] which one give clear picture-pdf, jpg or tiff?

Philipp Pagel p.pagel at wzw.tum.de
Fri Aug 20 23:26:34 CEST 2010


On Fri, Aug 20, 2010 at 09:30:18AM -0500, Stuart Luppescu wrote:
> On Fri, 2010-08-20 at 01:30 -0700, Joshua Wiley wrote:
> > I usually save them
> > from R as a PDF or postscript file, rasterize them in GIMP (free
> > answer to Photoshop) at the desired resolution, and finally choose the
> > desired format/compression (jpeg, png, bitmap, tiff, etc.) to save it
> > as from there.  
> 
> Woah. That's really involved. I use this little shell function to
> convert from ps to png:
> 
> function ps2png {
>   ps_file="$1"
>   png_file=`echo "$ps_file" | sed -e 's/\.ps$/.png/'`
>   gs -dQUIET -dNOPAUSE -dBATCH -sDEVICE=png16m -sOutputFile="$png_file" -r200x200 "$ps_file"
> }


I'd like to add yet another tool that I use on LINUX systems for this
purpose: imagemagick

# turn EPS into PNG at 600dpi
convert -density 600 foo.eps foo.png

Very conveniant, especially if there are lots of figures to be
converted:

for file in *.eps; do convert -density 600 $file `basename $file .eps`.png; done

cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/



More information about the R-help mailing list