Просмотр исходного кода

Reduce title size to 20 so that all titles fit

pull/23/head
Kirill Müller 7 лет назад
Родитель
Сommit
4f67d9d9a7
1 измененных файлов: 2 добавлений и 2 удалений
  1. +2
    -2
      R/02_functions.R

+ 2
- 2
R/02_functions.R Просмотреть файл

@@ -69,7 +69,7 @@ colorize_wide_tidyr <- function(df, n_colors, key_col = "id") {
select(-idc)
}

plot_data <- function(x, title = "") {
plot_data <- function(x, title = "", title_size = 20) {
if (!"alpha" %in% colnames(x)) x$alpha <- 1
if (!".text_color" %in% colnames(x)) x$`.text_color` <- "white"
if (!".text_size" %in% colnames(x)) x$`.text_size` <- 12
@@ -84,7 +84,7 @@ plot_data <- function(x, title = "") {
coord_equal() +
ggtitle(title) +
theme_void() +
theme(plot.title = element_text(family = "Fira Mono", hjust = 0.5, size = 24)) +
theme(plot.title = element_text(family = "Fira Mono", hjust = 0.5, size = title_size)) +
guides(fill = FALSE)
}


Загрузка…
Отмена
Сохранить