vignettes/web_only/theme_ggstatsplot.Rmd
theme_ggstatsplot.Rmd
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.
Here is a simple example:
# for reproducibility
set.seed(123)
library(ggplot2)
library(ggstatsplot)
combine_plots(
# basic scatter plot with `theme_ggstatsplot()` added
plotlist = list(
ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
ggstatsplot::theme_ggstatsplot(),
# basic scatter plot without the default theme
ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point()
),
nrow = 1,
annotation.args = list(title = "Plot with and without the default `theme_ggstatsplot` overlaid")
)
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.
ggcorrmat(
data = iris,
cor.vars = c(Sepal.Length:Petal.Width),
ggtheme = ggthemes::theme_fivethirtyeight(), # selected ggplot2 theme
ggstatsplot.layer = FALSE # turn of default theme layer
)
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
: https://github.com/IndrajeetPatil/ggstatsplot/issues
For details, see- https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/session_info.html