Simon Jackman wrote:
> On Sep 14, 2007, at 7:18 AM, Raffael Himmelsbach wrote:
>> Dear all,
>> I am on the search for a solution of the following problem in R:
>
> [stuff deleted]
>
>> But I
>> only want to shade the overlapping sections with simple lines, just
>> like the graphs in Tsebelis' "Veto Players".
>> I would be very thankful for any hints.
The gpclib package is pretty slick for this. Here is a simple example
with two overlapping circles.
library(gpclib)
makecirclepoly <- function(center,radius,numpts=1000) {
theta <- seq(0,2*pi,length=numpts)
verts <- cbind(center[1]+radius*cos(theta),center[2]+radius*sin(theta))
return( as(verts,"gpc.poly") )
}
c1 <- makecirclepoly(c(0,0),1.1)
c2 <- makecirclepoly(c(1,1),1.1)
plot(append.poly(c1,c2),axes=FALSE,xlab='',ylab='')
plot(intersect(c1,c2),poly.args=list(density=20,angle=30),add=TRUE)
points(0,0,pch=19,cex=0.7)
points(1,1,pch=19,cex=0.7)
Simon mentioned that you could you use various GUI drawing tools which
is certainly true. However, there is a huge advantage using a language
like R (or tex) to do this. Once you have you the basic framework it is
easy to draw or redraw any configuration of winsets (or whatever) that
you want without almost zero marginal effort.
Best,
Jeff
--
Jeffrey B. Lewis, Associate Professor
Department of Political Science
University of California Los Angeles
Los Angeles CA 90095
t: 310.206.5295 f: 310.825.0778
w: http://www.polisci.ucla.edu/faculty/lewis
**********************************************************
Political Methodology E-Mail List
Editors: Melanie Goodrich, <[log in to unmask]>
Delia Bailey, <[log in to unmask]>
**********************************************************
Send messages to [log in to unmask]
To join the list, cancel your subscription, or modify
your subscription settings visit:
http://polmeth.wustl.edu/polmeth.php
**********************************************************
|