rain cloud plot is generally visualize a the distribution of data in three different format in a single plot to make it beautiful and interesting. distribution plot, box plot and dot plot are combined together to make rain cloud plot. As in th box plot the distribution of data is not very clear,where as the distribution is quite more clear in the rain cloud plot.
2 Setting the theme for the plot
We should have ggdist package for for the distribution map . if it is not there, we can install it by install.packages("ggdist") .
library(tidyverse)
Warning: package 'ggplot2' was built under R version 4.3.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggdist)
Warning: package 'ggdist' was built under R version 4.3.3
theme_set(theme_minimal(base_size =12,base_family ='Source Sans Pro' ) +theme(panel.grid.minor =element_blank()))
We will work on Penguin dataset
Setting the colour for three species of penguins
colors <- thematic::okabe_ito(3)names(colors) <-unique(palmerpenguins::penguins$species)title_text <- glue::glue('Penguin weights (in g) for the Species', '<span style = "color:{colors["Adelie"]}">**Adelie**</span>,', '<span style = "color:{colors["Chinstrap"]}">**Chinstrap**</span>', 'and','<span style = "color:{colors["Gentoo"]}">**Gentoo**</span>', .sep =' ')