Przeglądaj źródła

Set plot title position to "plot" for ggplot2 >= 3.3.0

tags/v0.3.0
Garrick Aden-Buie 6 lat temu
rodzic
commit
c086ba95d8
1 zmienionych plików z 5 dodań i 1 usunięć
  1. +5
    -1
      R/ggplot2.R

+ 5
- 1
R/ggplot2.R Wyświetl plik

theme_xaringan_set_defaults(text_color, background_color, accent_color, accent_secondary_color) theme_xaringan_set_defaults(text_color, background_color, accent_color, accent_secondary_color)
} }


ggplot2::theme(
theme <- ggplot2::theme(
line = ggplot2::element_line(color = blend(0.2)), line = ggplot2::element_line(color = blend(0.2)),
rect = ggplot2::element_rect(fill = background_color), rect = ggplot2::element_rect(fill = background_color),
text = ggplot2::element_text( text = ggplot2::element_text(
color = blend(0.3) color = blend(0.3)
) )
) )

if (utils::packageVersion("ggplot2") >= package_version("3.3.0")) {
theme + ggplot2::theme(plot.title.position = "plot")
} else theme
} }


#' Set and Restore ggplot2 geom Defaults #' Set and Restore ggplot2 geom Defaults

Ładowanie…
Anuluj
Zapisz