Skip to content

Implement geom_GeomConfint() from ggsurvplot in plotly for plotting survival curves with confidence intervals #1404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rvenghat opened this issue Nov 14, 2018 · 1 comment

Comments

@rvenghat
Copy link

I'm currently working on converting survival curves plotted by ggsurvplot to a plotly chart. However it does not plot the confidence intervals provided by ggsurv. The following warning was generated when i tried to plot it.
Warning in geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomConfint() has yet to be implemented in plotly.
If you'd like to see this geom implemented,
Please open an issue with your example code at
https://github.com/ropensci/plotly/issues

This is the code to generate the plot using ggsurvplot

p<-ggsurvplot(
survfit(res),
xlab = "Chargeoff Time (Months)",
palette = "#2E9FDF",
data = final_data,
ggtheme = theme_minimal(),
ylab = "Loan Survival Probablity",
)

This is to generate the same plot using plotly

plotly::ggplotly(p$plot)

Can this be implemented?

@cpsievert
Copy link
Collaborator

Added to #566, but quite frankly, there are other extension packages that will likely take priority.

If you like to take a stab at providing a ggplotly plug-in yourself, see https://plotly-book.cpsievert.me/translating-custom-ggplot2-geoms.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants