Violin and density plots in ggplot2

Violin Plots This chart is a combination of a Box Plot and a Density Plo that is rotated and placed on each side, to show the distribution shape of the data. The thick black bar in the centre represents the interquartile range, the thin black line extended from it represents the 95% confidence intervals, and the white dot is the…

Continue Reading

Box Plots in ggplot2

Setting up the plot The box plot, in ggplot2, can be really powerful and useful for analysing variation. I will show a few examples of different types of box plots in ggplot2. Basic Box Plot 1 2 3 4 5 6 7 8 9 10 library(ggplot2) theme_set(theme_classic()) # Plot plot <- ggplot(mpg, aes(class, cty)) plot…

Continue Reading

Pareto Chart in ggplot2

Background of Pareto Charts A Pareto chart, named after Vilfredo Pareto, is a type of chart that contains both bars and a line graph, where individual values are represented in descending order by bars, and the cumulative total is represented by the line. These charts are highly utilised in Six Sigma circles and conform to the Pareto Principle. The construction…

Continue Reading