[R] Percentage scale on y-axis

David Winsemius dwinsemius at comcast.net
Mon Jan 2 16:10:08 CET 2012


On Jan 2, 2012, at 4:31 AM, Öhagen Patrik wrote:

> Seasonal Greetings!
>
> I am trying to plot a simple survival curve using;
>
> plot
> (survfit
> (Surv(d01,cens) ,conf.type="none" ),xlab="Time",ylab="Survival")
>

That does not look like a valid survival formula to me but maybe I'm  
insufficiently experienced.

> I would be interested in a percentage scale on the y-axis. How do I  
> achieve sucha scale?

Have you tried using xaxt="n" and then following up with  axis(2,  
at=seq(0,1,by=.2), labels=paste(100*seq(0,1,by=.2), "%") ) in the  
usual manner> (I think plot.coxph.survfit uses ordinary base graphics.)

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list