parvin karimi parvin karimi -4 years ago 140
R Question

floating pie() in plotrix package in R (adjusting the opening & closing pattern)

Background:

Presently, my "floating.pie" by plotrix package using:

plot(1:10,ty="n")

library(plotrix)

floating.pie(3, 8,c(.8, .2), 200 , 1, col=c("maroon","white"), lwd=2)


looks like this:

enter image description here

QUESTION: I was wondering if there might be an argument or a way so that floating pie ALWAYS looks downwards (always making a "V" or "/\" shape)?

For example, the above floating.pie becomes like this:

enter image description here

Answer Source

In your case, you can obtain the exact value of startpos as

startpos = (3*pi/2) + #Start at 3*pi/2 (facing generally downward)
           (0.2*2*pi/2) #Add half of the angle assigned for smaller value

#Then plot
plot(1:10,ty="n")
floating.pie(3, 8,c(.8, .2), 200 , 1, col=c("maroon","white"), lwd=2, startpos = startpos )
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download