[R] problems with Stackpoly, package Plotrix

Jim Lemon jim at bitwrit.com.au
Tue Sep 22 01:10:53 CEST 2009


On 09/21/2009 09:31 AM, Václav Varvařovský wrote:
> xpopis<-c(0.9,0.99,0.999)
> paste("1 in",round(1/(1-xpopis),1),sep=" ")
> #n as number of subjects is 4
> result<-c(0.3,0.15,0.4,0.15,0.5,0.1,0.12,0.28,0.45,0.25,0.2,0.1)
> stackpoly(x=matrix(nrow=3,ncol=4,xpopis),y=matrix(nrow=3,ncol=4,result,byrow=T),
>       xlim=c(0.85,1),ylim=c(0,1),
>      xaxlab=paste("1 in",round(1/(1-xpopis),1),sep=" "),xat=xpopis,
>       col=c("blue","red","green","cyan"),
> border=gray(0.4),lty="dotted",lwd=0.1,stack=T,srt=45)
>    
Hi again,
This gives me a better idea of what you want. If you make your third 
line in the call:

xaxlab=c("","",""),xat=xpopis,

and then:

par(xpd=TRUE)
text(c(0.9,0.99,1),c(-0.06,-0.06,0.06),
  c("1 in 10","1 in 100","1 in 1000"),srt=45)

I think you will get what you want.

Jim




More information about the R-help mailing list