-
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
risk table does not align with plot when legend="right" #102
Comments
Thank you for reporting this issue. I'll work on it |
kassambara
added a commit
that referenced
this issue
Feb 28, 2017
Fixed now: # Fit survival curves
library(survival)
fit <- survfit( Surv(time, status) ~ rx + adhere, data = colon )
# Plot with legend = "right"
library(survminer)
ggsurvplot(fit, data = lung,
risk.table = TRUE,
cumevents = TRUE,
palette = "jco",
tables.height = 0.2,
tables.y.text = FALSE,
tables.theme = theme_cleantable(),
ggtheme = theme_light(),
legend = "right"
) |
Hi, where are the 'tables.height', tables.y.text', and 'theme_cleantable()' from please |
Hi @Jitsuka, You should install the latest developmental version of survminer as follow: if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/survminer", build_vignettes = FALSE) After that, it should work. |
Thanks, will try at home, currently sitting behind corporate firewall at work ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
when setting risk.table=T and legend="right", I would expect the right margin of the risk table to grow by the width of the legend such that the x-axis of the risk table is on the same scale as the x axis of the survival plot, ie the number at risk aligns with the relevant time point on the plot.
Actual behavior
Setting legend="right" narrows the survival plot to make room for the legend, but does not narrow the risk table accordingly. As a result, the alignment of the x axes is lost.
Steps to reproduce the problem
ggsurvplot(data.survfit, risk.table = T, legend = "right")
session_info()
Session info ---------------------------------------------------------------------------
setting value
version R version 3.3.2 (2016-10-31)
system x86_64, linux-gnu
ui RStudio (0.99.896)
language en_CA:en
collate en_CA.UTF-8
tz
date 2016-12-29
Packages -------------------------------------------------------------------------------
package * version date source
acepack 1.3-3.3 2014-11-24 CRAN (R 3.3.0)
assertthat 0.1 2013-12-06 CRAN (R 3.3.2)
BH * 1.60.0-2 2016-05-07 cran (@1.60.0-)
bigmemory * 4.4.6 2013-11-18 CRAN (R 3.3.0)
bigmemory.sri * 0.1.3 2014-08-18 CRAN (R 3.3.0)
chron 2.3-47 2015-06-24 CRAN (R 3.3.0)
cluster 2.0.5 2016-10-08 CRAN (R 3.3.1)
codetools 0.2-15 2016-10-05 CRAN (R 3.3.1)
colorspace 1.2-2 2013-04-11 CRAN (R 3.0.0)
data.table 1.9.6 2015-09-19 CRAN (R 3.3.0)
devtools 1.12.0 2016-06-24 CRAN (R 3.3.1)
digest 0.6.10 2016-08-02 cran (@0.6.10)
foreign 0.8-67 2016-09-13 CRAN (R 3.3.1)
Formula * 1.2-1 2015-04-07 CRAN (R 3.3.0)
ggplot2 * 2.2.0 2016-11-11 CRAN (R 3.3.2)
gridExtra 2.2.1 2016-02-29 CRAN (R 3.3.0)
gtable 0.1.2 2012-12-05 CRAN (R 3.0.0)
Hmisc * 3.17-4 2016-05-02 CRAN (R 3.3.0)
labeling 0.1 2012-10-29 CRAN (R 3.0.0)
lattice * 0.20-34 2016-09-06 CRAN (R 3.3.1)
latticeExtra 0.6-28 2016-02-09 CRAN (R 3.3.0)
lazyeval 0.2.0 2016-06-12 CRAN (R 3.3.2)
magrittr 1.5 2014-11-22 cran (@1.5)
MASS 7.3-44 2015-08-30 CRAN (R 3.2.2)
Matrix 1.2-7.1 2016-09-01 CRAN (R 3.3.1)
MatrixModels 0.4-1 2015-08-22 CRAN (R 3.3.0)
memoise 1.0.0 2016-01-29 CRAN (R 3.3.1)
multcomp 1.4-5 2016-05-04 CRAN (R 3.3.0)
munsell 0.4.2 2013-07-11 CRAN (R 3.0.2)
mvtnorm 1.0-5 2016-02-02 CRAN (R 3.3.0)
nlme 3.1-128 2016-05-10 CRAN (R 3.3.1)
nnet 7.3-12 2016-02-02 CRAN (R 3.2.3)
plyr 1.8.4 2016-06-08 CRAN (R 3.3.2)
polspline 1.1.12 2015-07-14 CRAN (R 3.3.0)
quantreg 5.24 2016-05-14 CRAN (R 3.3.0)
RColorBrewer 1.1-2 2014-12-07 cran (@1.1-2)
Rcpp 0.12.7 2016-09-05 cran (@0.12.7)
rms * 4.5-0 2016-04-04 CRAN (R 3.3.0)
rpart 4.1-10 2015-06-29 CRAN (R 3.2.1)
sandwich 2.3-4 2015-09-24 CRAN (R 3.3.0)
scales 0.4.1 2016-11-09 CRAN (R 3.3.2)
SparseM * 1.7 2015-08-15 CRAN (R 3.3.0)
survival * 2.40-1 2016-10-30 CRAN (R 3.3.2)
survminer * 0.2.4.999 2016-12-29 Github (7189a74)
TH.data 1.0-7 2016-01-28 CRAN (R 3.3.0)
tibble 1.2 2016-08-26 CRAN (R 3.3.2)
withr 1.0.2 2016-06-20 CRAN (R 3.3.1)
zoo 1.7-13 2016-05-03 CRAN (R 3.3.0)
The text was updated successfully, but these errors were encountered: