dpi = 300,
  out.width = "100%",
  collapse = TRUE,
  comment = "#>"

Default theme for the package: theme_ggstatsplot

ggstatsplot uses a default theme theme_ggstatsplot(), which is a selected ggplot2 theme with few aesthetic modifications overlaid on top, that can be used with any ggplot2 object. Alternative name for this function is theme_mprl.

Here is a simple example:


  # basic scatter plot
    data = datasets::mtcars,
    mapping = ggplot2::aes(x = wt, y = mpg)
  ) +
  # basic scatter plot with theme_ggstatsplot() added
    data = datasets::mtcars,
    mapping = ggplot2::aes(x = wt, y = mpg)
  ) +
    ggplot2::geom_point() +
  labels = c("(i)", "(ii)"),
  nrow = 1,
  title.text = "Plot with and without ggstatsplot theme"

All plots in this package have theme_bw() by default as the base on which theme_ggstatsplot() is built, but this can be modified using the ggtheme argument. Let's see an example with ggcorrmat function.

  data = datasets::iris,
  cor.vars = c(Sepal.Length:Petal.Width),
  matrix.type = "upper",
  ggtheme = ggthemes::theme_fivethirtyeight(),            # selected ggplot2 theme
  ggstatsplot.layer = FALSE

Try modifying the theme for other functions (use themes from ggplot2, ggthemes, hrbrthemes, etc.)!


If you find any bugs or have any suggestions/remarks, please file an issue on GitHub:

Session Information

For details, see-

IndrajeetPatil/ggstatsplot documentation built on June 17, 2019, 1:34 p.m.