Horje
ggplot2 histogram Code Example
ggplot2 histogram
library(ggplot2)
# Basic histogram
ggplot(df, aes(x=weight)) + geom_histogram()
# Change the width of bins
ggplot(df, aes(x=weight)) + 
  geom_histogram(binwidth=1)
# Change colors
p<-ggplot(df, aes(x=weight)) + 
  geom_histogram(color="black", fill="white")
p
ggplot2 histogram
# Add mean line
p+ geom_vline(aes(xintercept=mean(weight)),
            color="blue", linetype="dashed", size=1)
# Histogram with density plot
ggplot(df, aes(x=weight)) + 
 geom_histogram(aes(y=..density..), colour="black", fill="white")+
 geom_density(alpha=.2, fill="#FF6666") 




Python

Related
python remove non letters from string Code Example python remove non letters from string Code Example
pyvenv.cfg file download Code Example pyvenv.cfg file download Code Example
pandas print first column Code Example pandas print first column Code Example
python infinite value Code Example python infinite value Code Example
discord.py change status Code Example discord.py change status Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7