[R] transparent concentric circles

2010-02-09 Thread Karin Lagesen
I have a data set which I would like to plot as a set of concentric
circles. The data represent a count of the number of characteristics
shared by various elements - an example would look like this:

1 100
2 75
3 50
4 25

I.e. all four sets share 25 characteristics, three of them share 50
characteristics, and so on.

I would like to plot these as concentric circles, with the circle size
preferentially being proportional to the size of the number of elements
(this is not a must, however). I would also like the colors of the circles
to become stronger/deeper as we progress to the innermost circle (which
would be the one containing the number of characteristics shared by all
four).

Can somebody point me to what I can use to do this?

Thanks!



Karin
-- 
Karin Lagesen, PhD

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] transparent concentric circles

2010-02-09 Thread Barry Rowlingson
On Tue, Feb 9, 2010 at 2:20 PM, Karin Lagesen kar...@cbs.dtu.dk wrote:
 I have a data set which I would like to plot as a set of concentric
 circles. The data represent a count of the number of characteristics
 shared by various elements - an example would look like this:

 1 100
 2 75
 3 50
 4 25

 I.e. all four sets share 25 characteristics, three of them share 50
 characteristics, and so on.

 I would like to plot these as concentric circles, with the circle size
 preferentially being proportional to the size of the number of elements
 (this is not a must, however). I would also like the colors of the circles
 to become stronger/deeper as we progress to the innermost circle (which
 would be the one containing the number of characteristics shared by all
 four).

 Can somebody point me to what I can use to do this?

 help.search(circle)?

Have you tried any of those? Specifically:

plotrix::draw.circleDraw a circle.
shape::filledcircle adds colored circle to a plot
grid::grid.circle   Draw a Circle

 - assuming you have those packages loaded...

Barry

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] transparent concentric circles

2010-02-09 Thread Jim Lemon

On 02/10/2010 01:20 AM, Karin Lagesen wrote:

I have a data set which I would like to plot as a set of concentric
circles. The data represent a count of the number of characteristics
shared by various elements - an example would look like this:

1 100
2 75
3 50
4 25

I.e. all four sets share 25 characteristics, three of them share 50
characteristics, and so on.

I would like to plot these as concentric circles, with the circle size
preferentially being proportional to the size of the number of elements
(this is not a must, however). I would also like the colors of the circles
to become stronger/deeper as we progress to the innermost circle (which
would be the one containing the number of characteristics shared by all
four).

Can somebody point me to what I can use to do this?


Hi Karin,
As Barry noted, you can use draw.circle in the plotrix package:

plot(0,xlim=c(-100,100),ylim=c(-100,100),type=n,axes=FALSE,
 main=Set intersection plot,xlab=,ylab=)
par(xpd=TRUE)
draw.circle(0,0,100,col=#ffccff)
draw.circle(0,0,75,col=#ff99ff)
draw.circle(0,0,50,col=#ff44ff)
draw.circle(0,0,25,col=#ff00ff)
par(xpd=FALSE)

These aren't transparent, but if you really need transparency, just add 
the alpha level to the colors. Look at boxed.labels to label the circles.


Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.