-
Notifications
You must be signed in to change notification settings - Fork 164
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
Font family not getting applied to risk table and p-value in ggsurvplot #245
Comments
Fixed now, thanks! The elements in the risk table are text elements not theme elements. To change the font family, specify the arguments:
as follow: library(survival)
library(survminer)
# Fit survival curves
fit<- survfit(Surv(time, status) ~ sex, data = lung)
# Visualize
ggsurvplot(fit,
risk.table = TRUE,
risk.table.pos = "in",
pval = TRUE,
ggtheme = theme_classic2(base_family = "Courier New"),
font.family = "Courier New"
) |
Thanks for such a quick fix. I tried using the code you provided. There still seems to be problem with the font family getting applied to the p-value. The font family for p-value is still the default font instead of "Courier New". Is there a way to change the font family of p-value also? |
It works for me. Please, make sure that you have installed the latest developmental version. |
Oh sorry, I thought that you were taking about the risk table. The issue is now fixed for the p-value. Please re-install. It should work. Thanks |
Thank you for the fix. It works perfectly now. |
I tried changing the font family for ggsurvplot using the following code:
I got the following plot :
As you can see in the plot, font family gets applied to all the plot parameters except the risk table and p-value. Is there a way to resolve the issue?
Thank you!
The text was updated successfully, but these errors were encountered: