data visualization ggplot
data visualization ggplot
The ggplot() function initializes a plot, and you add layers using +:
2. Scatter Plot
geom_point() +
theme_minimal()
3. Line Graph
geom_line(color = "blue") +
xlab("Year") + ylab("Unemployment") +
theme_light()
4. Bar Chart
theme_bw()
5. Histogram
ggtitle("Distribution of MPG") +
theme_classic()
6. Boxplot
geom_boxplot(fill = "pink") +
theme_minimal()
7. Faceted Plot
geom_point() +
facet_wrap(~class) +