[R] plot(cox.zph()): customize xlab & ylab

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jul 11 15:20:31 CEST 2005


On 7/11/2005 9:10 AM, Adaikalavan Ramasamy wrote:
> Duncan, your solution could be simplified using ann=FALSE in the plot
> 
>  fit <- coxph( Surv(futime, fustat) ~ age + rx, ovarian)
>  plot( cox.zph(fit), ann=F )
>  title( xlab="My own label", ylab="A new label", main="A clever title")
> 
> Now, why did I not think of this before ?

That's nearly perfect.  I think the only problem is that plot.cox.zph 
can do multiple frames, and this will only allow annotation on the last 
one.  But if you put it in a loop and do them one at a time, this should 
be fine.

Duncan Murdoch

> 
> Regards, Adai
> 
> 
> 
> On Mon, 2005-07-11 at 07:50 -0400, Duncan Murdoch wrote:
>> Adaikalavan Ramasamy wrote:
>> > I am not sure if there is an easy way around this. An ugly hack is to
>> > make a copy the function "survival:::plot.cox.zph" and make your
>> > modified function. But there are others in the list who might know
>> > neater solutions.
>> 
>> This hack is uglier (and might not work properly on some devices, but 
>> you could try):
>> 
>> plot(cox.zph(my.ph),var=1,col.lab="white")
>> title(xlab="Year", ylab="Beta for blah blah blah")
>> 
>> Duncan Murdoch
>> > 
>> > Regards, Adai
>> > 
>> > 
>> > On Mon, 2005-07-11 at 11:10 +0100, Dan Bebber wrote:
>> > 
>> >>Hello,
>> >>
>> >>plot(cox.zph(my.ph),var=1,xlab="Year")
>> >>
>> >>gives the error:
>> >>Error in plot.default(range(xx), yr, type = "n", xlab
>> >>= "Time", ylab = ylab[i],  : formal argument "xlab"
>> >>matched by multiple actual arguments
>> >>
>> >>How can I customize the xlab and ylab for plots of
>> >>cox.zph?
>> >>
>> >>Thanks,
>> >>Dan Bebber
>> >>
>> >>Department of Plant Sciences
>> >>University of Oxford
>> >>UK
>> >>
>> >>
>> >>		
>> >>___________________________________________________________ 
>> >>How much free photo storage do you get? Store your holiday
>> >>
>> >>______________________________________________
>> >>R-help at stat.math.ethz.ch mailing list
>> >>https://stat.ethz.ch/mailman/listinfo/r-help
>> >>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>> >>
>> > 
>> > 
>> > ______________________________________________
>> > R-help at stat.math.ethz.ch mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>> 
>>




More information about the R-help mailing list