[R] displaying intensity through opacity on an image (ONE SOLUTION)

jiho jo.irisson at gmail.com
Sat May 19 20:32:27 CEST 2007


On 2007-May-19  , at 15:08 , Ranjan Maitra wrote:
> On Sat, 19 May 2007 22:05:36 +1000 Jim Lemon <jim at bitwrit.com.au>  
> wrote:
>> Ranjan Maitra wrote:
>>> ...
>>> (we are out of R).
>>>
>>> And then look at the pdf file created: by default it is Rplots.pdf.
>>>
>>> OK, now we can use gimp, simply to convert this to .eps.  
>>> Alternatively on linux, the command pdftops and then psto epsi on  
>>> it would also work.
>>>
>>> Yippee! Isn't R wonderful??
>>>
>> Sure is. You could probably save one step by using postscript()  
>> instead
>> of pdf() and get an eps file directly. The reason I didn't answer the
>> first time is I couldn't quite figure out how to do what you wanted.
>
> Thanks, Jim! Not a problem, But will postscript() work? I thought  
> that help file said that only pdf and MacOSX quartz would work (at  
> the time it was written).
>
> It certainly does not work for me on the screen.
>
> Btw, I made an error in writing the previous e-mail: the command to  
> convert to .eps from .ps is ps2epsi.

I haven't followed the discussion from the beginning but,  
independently of R, some image formats support transparency while  
others don't. PDF supports transparency but EPS and PS don't. So you  
can't expect R's postscript() device to support it (and you will  
loose it when converting a pdf to and eps or a ps file). SVG support  
transparency beautifully and you'll be able to edit it with Inkscape  
(which is cross platform). R can produce SVG thrhough the package  
RSvgDevice.
Furthermore, if you open a PDF (or any vector based format such as  
EPS or PS) with Gimp it will "rasterize" it: convert the vector  
information to pixels. You'll be able to save it to many formats but  
it will still be pixel based (zooming on it will reveal pixels while  
it's not true with vector based formats).
http://en.wikipedia.org/wiki/Vector_Graphics
http://en.wikipedia.org/wiki/Raster_graphics

Hope that helps.

JiHO
---
http://jo.irisson.free.fr/



More information about the R-help mailing list