Quantcast

How to plot draw polygon on pie chart?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

How to plot draw polygon on pie chart?

Manish Gupta
This post has NOT been accepted by the mailing list yet.
Hi,

I am attempting to draw polygon on pie chart

pie(c(1,2,3,4,5))
R<-0.8
r<-0.2
angle<-45*0.0174532925
angle2<-(angle-15)*0.0174532925
angle3<-(angle+15)*0.0174532925
xpos<-R*cos(angle)
ypos<-R*sin(angle)
x1<-r*cos(angle2)
y1<-r*sin(angle2)
x2<-r*cos(angle3)
y2<-r*sin(angle3)
x<-c(0,x1,xpos,x2,0)
y<-c(0,y1,ypos,y2,0)

polygon(x,y, xpd=xpd, col="black", lty=1, lwd=2, border="black")
draw.circle(0,0,radius=.01,col="white")

But i get error message that plot.new has not been called. How can i draw polygon on pie chart?

Regards
Loading...