Default theme (theme_mprl)

Indrajeet Patil

2018-05-22

Default theme for the package: theme_mprl

ggstatsplot uses a default theme theme_mprl() that can be used with any ggplot2 object.

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()


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

All plots in this package have this theme by default. For example, since the ggcorrmat allows you to use different ggplot2 themes, it contains an argument to prevent overlaying the default ggstatsplot theme. Otherwise, whichever ggtheme you chose will just be overridden by the ggstatsplot theme.

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

Contrast this what it looks like if you don’t turn off the default theme overlay:

ggstatsplot::ggcorrmat(
  data = datasets::iris,
  cor.vars = c(Sepal.Length:Petal.Width),
  type = "upper",
  ggtheme = ggplot2::theme_dark,         # selected ggplot2 theme
  ggstatsplot.theme = TRUE                # overlaying theme_mprl on 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