Skip to content
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

Risk table fails to respect x-axis breaks when x-axis is duplicated #221

Open
psoldath opened this issue Jul 18, 2024 · 0 comments
Open

Comments

@psoldath
Copy link

The risk table fails to respect the x-axis breaks when the x-axis is duplicated. Is this fixable? If so, I think it would be worthwhile to try and fix it as it would allow users to customize plots even further.

Risk table when x-axis is duplicated

library(ggsurvfit)

survfit2(Surv(time, status) ~ surg, data = df_colon) |> 
  ggsurvfit() +
  add_risktable() +
  scale_x_continuous(sec.axis = dup_axis())

Rplot

Fixing the problem would allow users to customize plots even further, such as....

library(ggplot2)

mpg |> 
  ggplot(aes(displ, hwy)) +
  geom_point() +
  scale_x_continuous(sec.axis = dup_axis(name = NULL, labels = NULL)) +
  scale_y_continuous(sec.axis = dup_axis(name = NULL, labels = NULL)) +
  theme_classic() +
  theme(axis.ticks.length = unit(-4, "pt"))

Rplot01

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

No branches or pull requests

1 participant