Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Berry, Charles
> On Oct 24, 2017, at 2:56 AM, Alaios via R-help wrote: > > Hi all,I would like to draw a simple circle where the color gradient follows > the rule color = 1/(r^2) where r is the distance from the circle. This is called a radial gradient fill in SVG speak. [snip] > but this package does not

Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Jim Lemon
Hi Alex, This is harder than it looks for a number of reasons. First you want to desaturate the colors as you move out, which requires something more sophisticated than the approximation I have done in the code below. RGB may not be the best colorspace to use for this. Second is that when you draw

Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Bert Gunter
There are lots of different ways to do this. I don't use plotrix, which uses base R graphics functionality, so I can't help you with your current approach. However, it is easy to do this "by hand" in the newer, object-based grid package (on which ggpot and lattice are built) . The idea, which proba

[R] draw a circle with a gradient fill

2017-10-24 Thread Alaios via R-help
Hi all,I would like to draw a simple circle where the color gradient follows the rule color = 1/(r^2) where r is the distance from the circle. I would also like to add a color bar with values going from -40 to -110 (and associate those with the color gradient that fills the circle). So far I exp