Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upggsurvplot() and axes offset from the origin #196
Comments
|
New argument |
|
Hello, @kassambara How can I make sure the 100% in the figure ? |
|
@ShixiangWang I was able to fix it by just increasing the y limits. ylim=c(0,1.01) |
|
@akirosingh Thanks :) |


(User request by e-mail)
ggsurvplot follow the standard R/ggplot convention of having the axes offset from the origin (I have never understood why this is the case – since basic mathematics you always show x=y=0 as the origin). Normally I would get around this by using yaxs="i" in plot, and I believe there is a similar way with expand limits in ggplot, however when I do this, the axis disappears.
Normally it is a bit of an annoyance, but with Kaplan-Meier plots is actually quite critical – after all we want to see when survival hits y=0 – with the values offset and a large number of patients you aren’t sure if it has hit 0, or there is still someone left! Any advice would be great, and even better if the default in the package was changed at the next update, as those who would want it offset must be in a minority i.e. nobody. Also if someone isn’t fussy, they should get the more accurate version!