My question: How do I find the boundaries for the plot area?
I'm using the plotHR function for plotting splines from cox regressions. I've done some adaptations found here and the density plot annoys me so I want to be able to change it to a simple regular polygon without the need for using a second plot. The problem is that the second plot needs repositioning as soon as the medium size changes.
Now I know I can use the plot_boundaries.y and plot_boundaries.x together with the limits and adding the xaxs/yaxs information but this seems like not the most intuitive way of doing this. Is there an easy way of getting my plots bottom left x,y and top right x,y?
Here's an example of how to use the plotHR:
library(survival)
hmohiv<-read.table("http://www.ats.ucla.edu/stat/R/examples/asa/hmohiv.csv", sep=",", header = TRUE)
surv <- with(hmohiv, Surv(time, censor))
fit <- coxph(surv~ pspline(age), data=hmohiv)
par(xaxs="i", yaxs="i")
plotHR(fit, bty="l", ylim=c(.4, 5), y.ticks=c(.5, 1, 1.5, 2, 3, 4), xlim=c(25, 55))