shaded triplot in r

Viewed 1745

I could figure out triplot using package klaR. .......

   require(klaR)

triplot(label = c("1, 2 or 3", "4 or 5", "6"), 
    main = "die rolls: probabilities", pch = 17)

I want to plot shaded triplot, so that I can show where particular point falls into which class.

Are there any package (developed or underdevelopment) to do this ? Or we can tweak the available packages to achieve this ?

enter image description here

Edits: in response to the answer below:

xpoint <- matrix(c(0, 0, 10,  0, 10, 0, 10,0,0, 10,10, 0, 10,0,10, 0,0, 10, 0,10,10, 10,10,10), ncol =3, byrow= TRUE)
xp <- t(apply(xpoint,1,tern2cart))
points(xp[,1], y = xp[,2], type = "p", col = "green", pch = "*", cex = 4)
text(xp[,1]-0.01,xp[,2]-0.01)
> xpoint 


       [,1] [,2] [,3]
    [1,]    0    0   10
    [2,]    0   10    0
    [3,]   10    0    0
    [4,]   10   10    0
    [5,]   10    0   10
    [6,]    0    0   10
    [7,]    0   10   10
    [8,]   10   10   10

enter image description here

2 Answers
Related