plots: Change color palette

Change color palette to "lancet".
This commit is contained in:
Jens Sauer 2021-01-18 01:48:28 +01:00
parent 63c2883c7e
commit c012fc65fe
4 changed files with 7 additions and 1 deletions

View File

@ -80,7 +80,7 @@ sma_plot_secmal_cmprsk <- function() {
cpr <- cuminc(secmal$time_at_risk / 365.25, secmal$time_at_risk_status) cpr <- cuminc(secmal$time_at_risk / 365.25, secmal$time_at_risk_status)
ggcompetingrisks(cpr[1], conf.int = TRUE, multiple_panels = FALSE, ggcompetingrisks(cpr[1], conf.int = TRUE, multiple_panels = FALSE,
legend = "none", title = "", ylim = c(0:1), legend = "none", title = "", ylim = c(0:1),
xlab = "Years") xlab = "Years", ggtheme = theme_bw(), palette = "lancet")
} }
# Calculate cumuative risk with ci from cuminc. # Calculate cumuative risk with ci from cuminc.

View File

@ -40,6 +40,7 @@ sma_plot_surv_asct <- function() {
risk.table = "abs_pct", risk.table = "abs_pct",
legend = "none", legend = "none",
xlab = "Years", xlab = "Years",
palette = "lancet",
ggtheme = theme_bw()) ggtheme = theme_bw())
} }
@ -80,6 +81,7 @@ sma_plot_surv_sm <- function() {
break.time.by = 365.25, break.time.by = 365.25,
legend = "none", legend = "none",
xlab = "Years", xlab = "Years",
palette = "lancet",
ggtheme = theme_bw()) ggtheme = theme_bw())
} }

View File

@ -7,6 +7,7 @@ library(survival)
library(survminer) library(survminer)
library(tidyverse) library(tidyverse)
library(cmprsk) library(cmprsk)
library(ggsci)
# #
# Write plot to filename # Write plot to filename

View File

@ -70,7 +70,10 @@ sma_jitt_dx_year <- function() {
ggplot(data, aes(x = asct_year, y = dx, colour = dx, fill = dx)) + ggplot(data, aes(x = asct_year, y = dx, colour = dx, fill = dx)) +
geom_jitter(width = 0.4, height = 0.2) + geom_jitter(width = 0.4, height = 0.2) +
labs(x = "Year", y = "Diagnosis") + labs(x = "Year", y = "Diagnosis") +
theme_bw() +
theme(legend.position = "none") + theme(legend.position = "none") +
scale_color_lancet() +
scale_fill_lancet() +
xlim(1990, 2020) xlim(1990, 2020)
} }