[R] (no subject)

bibek sharma mbhpathak at gmail.com
Fri Nov 30 23:06:39 CET 2012


Hello R usuer,

The code given below superimposes a pie diagram on another plot
containing some points. However, I would like to center the pie
diagram on the xy location on the plot, but not on the center. is
there any way to re-center pic diagram.
Any suggestion or better alternative are highly appreciated.
Thank you in advance for your help.

Regards,
Bibke

library(visualFields)
library(car)
a<-saplocmap$p24d2
ordinate<-data.frame(a$xod,a$yod)
plot( a$xod,a$yod, xlim=c(-30,30),
ylim=c(-30,30),xlab="",ylab="",type="p", data=ordinate)
abline(v=0,h=0)
par(new=TRUE)

# Define cars vector with 8 values
cars <- c(1,1,1,1,1,1,1,1)

# Define colors in each sector

color1 <- c("grey80","grey80","grey80","grey80","gray80","grey30","grey20","gray10"
) ## gray10=<0.0001, gray20<0.001, gray30<0.01, gray40=<0.05, gray
80=>0.05
# Putting sector levels
car_labels <- c(1,2,3,4,5,6,7,8)
car_labels <- paste(car_labels,sep="")

# Create a pie chart with defined heading and custom colors
# and labels

pie(cars, main="Sectors", col=color1, labels=" ",
radius=0.05,border=NA, cex=0.8)




More information about the R-help mailing list