ggstatsplot theme

knitr::opts_chunk$set( 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:

library(ggplot2) # Basic scatter plot ggplot2::ggplot( data = datasets::mtcars, mapping = ggplot2::aes(x = wt, y = mpg) ) + ggplot2::geom_point() + ggplot2::theme_bw() # Basic scatter plot with theme_ggstatsplot() added ggplot2::ggplot( data = datasets::mtcars, mapping = ggplot2::aes(x = wt, y = mpg) ) + ggplot2::geom_point() + ggstatsplot::theme_ggstatsplot(ggtheme = ggplot2::theme_bw())

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 provided for all functions. For example, for the ggbetweenstats function the default theme can be changed to, for example, theme_grey():

ggstatsplot::ggbetweenstats( data = datasets::iris, x = Species, y = Sepal.Length, ggtheme = ggplot2::theme_grey() # selected ggplot2 theme )

Another example with ggscatterstats:

ggstatsplot::ggscatterstats( data = datasets::iris, x = Sepal.Width, y = Sepal.Length, ggtheme = ggplot2::theme_dark() # selected ggplot2 theme )

The only exception for how ggtheme argument is to be entered is ggcorrmat function where the theme should not be entered as a function.

ggstatsplot::ggcorrmat( data = datasets::iris, cor.vars = c(Sepal.Length:Petal.Width), type = "upper", ggtheme = ggplot2::theme_dark # selected ggplot2 theme )

Suggestions

If you find any bugs or have any suggestions/remarks, please file an issue on GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues