Consider this toy example in R
x<-seq(0,1,length.out=10)
y<-sin(x)
plot(x,y)
set.seed(10)
weights <- matrix(runif(30),ncol=3)
weights <- sweep(weights,1,apply(weights,1,sum),"/")
where each point has probabilities associated with being in 3 groups. For example, the first observation has
[,1] [,2] [,3]
[1,] 0.2507483 0.32198731 0.4272644
0.25 probability of being in group 1, 0.32 of being in group 2 and 0.43 of being in group 3. How can I make a plotting symbol for each point to look like a mini pie chart that will colour the pie chart accordingly? For example, for the first point, the plotting symbol would look like this
pie(weights[1,],labels=NA)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.