Hi R-users and R-experts: Is it posible to make transparent graphics on R? I mean, one graphic with colors over another one but both visible with transparent options? Thank you for your help Kenneth --
Kenneth - Using base package graphics, use plot() on the first call, then either points() or lines() on subsequent calls to build up a single plot, layer by layer. Each call can use an argument col=... . However, the colors themselves are not transparent, AFAIK, so that where two symbols are plotted on top of each other, only the top layer shows. If you need to give the appearance of color mixing, you will have to identify which points coincide, and plot those again using a third color. I don't use lattice graphics, but I presume the situation is much the same. - tom blackwell - u michigan medical school - ann arbor - On Tue, 14 Oct 2003, Kenneth Cabrera wrote:> Hi R-users and R-experts: > > Is it posible to make transparent graphics on R? > I mean, one graphic with colors over another one > but both visible with transparent options? > > Thank you for your help > > Kenneth
Hi Kenneth Cabrera wrote:> Hi R-users and R-experts: > > Is it posible to make transparent graphics on R? > I mean, one graphic with colors over another one > but both visible with transparent options?In general this is not possible, but ... If you are prepared to work with grid graphics, and produce SVG output, and use a very experimental package, then take a look at the gridSVG package (http://www.stat.auckland.ac.nz/~paul/index.html). The package has a vignette with a very simple example of transparency and there are a couple more examples in some talk slides also linked off the page given above. The package has some serious deficiencies, but I have seen one reasonably complex real usage of it. A general alpha transparency graphical parameter may be added to R in the near future, but even then this will not be respected by all output formats. Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/