#rprogramming #ggplot2 #ggextra #marginalplot #datadistribution #scatterplot
In this video, I have explained plotting marginal plots using ggplot2 and its extension package ggExtra
Marginal plots ar scatter plots with distribution plots on the margin
Scatter plots show relationship but assessing and comparing distribution from scatter is not easy on the eyes.
Marginal plots help the audience to see and compare distributions without any effort.
The marginal plots can be any of the distribution plot- densityplot, histogram, boxplot, violin plot or densigram. Densigram is a combination of histogram and densityplot.
code
install.packages("ggExtra")
library(ggExtra)
library(ggplot2)
str(iris)
p = ggplot(iris,aes(Sepal.Length,Sepal.Width,color=Species))+
geom_point()+
theme_bw()+
theme(legend.position = "bottom")+
geom_smooth()
ggMarginal(p,groupColour = TRUE,groupFill = TRUE,type="density")
Facebook page:
https://www.facebook.com/RajendraChoureISC
Mail Id:
[email protected]
youtube playlist:
https://www.youtube.com/playlist?list=PLfAzV0jqypOjX2h3YkeETd5RRO6f3VXpE