#rprogramming #datavisualization #ggplot2 #ggside #sideplots #marginalplots
In this video I have demonstrated the use of geom_^side^ to get different side plots to enhance scatterplot by showing the distribution of the numeric variable.
#code
library(ggside)
head(iris)
library(ggplot2)
ggplot(iris,aes(Sepal.Length,Petal.Length,fill=Species, color=Species))+
geom_point()+
geom_xsideboxplot()+
geom_ysidedensity(alpha=0.3)+
theme_classic()+
theme(ggside.panel.scale=0.3, legend.position = "bottom")
ggplot(iris,aes(Sepal.Length,Petal.Length,fill=Species, color=Species))+
geom_point()+
geom_xsidebar(alpha=0.3)+
geom_ysidehistogram(alpha=0.3)+
theme_classic()+
theme(ggside.panel.scale=0.3, legend.position = "bottom")
library(ggside)
head(iris)
library(ggplot2)
ggplot(iris,aes(Sepal.Length,Petal.Length,fill=Species, color=Species))+
geom_point()+
geom_xsideboxplot()+
geom_ysidedensity(alpha=0.3)+
theme_classic()+
theme(ggside.panel.scale=0.3, legend.position = "bottom")
ggplot(iris,aes(Sepal.Length,Petal.Length,fill=Species, color=Species))+
geom_point()+
geom_xsidebar(alpha=0.3)+
geom_ysidehistogram(alpha=0.3)+
theme_classic()+
theme(ggside.panel.scale=0.3, legend.position = "bottom")
Facebook page:
/ rajendrachoureisc
Mail Id:
[email protected]
youtube playlist:
• R programming tutorials