library(ggplot2)
library(esquisse)
GRAPH 1
library(ggplot2)
data <- mpg
ggplot(data) +
aes(x = displ, y = hwy, size = class) +
geom_point(shape = "circle", colour = "#112446") +
theme_minimal()
## Warning: Using size for a discrete variable is not advised.
GRAPH 2
ggplot(data) +
aes(x = displ, y = hwy) +
geom_point(shape = "circle", size = 1.5, colour = "#112446") +
theme_minimal() +
facet_grid(vars(drv), vars(cyl))
GRAPH 3
ggplot(data) +
aes(x = displ, y = hwy, fill = drv, colour = drv, shape = drv, group = drv) +
geom_point(size = 1.5) +
geom_smooth(span = 0.75) +
scale_fill_hue(direction = 1) +
scale_color_hue(direction = 1) +
theme_minimal()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
GRAPH 4
ggplot(diamonds) +
aes(x = cut, fill = clarity) +
geom_bar(position = "dodge") +
theme_minimal() +
theme(legend.position = "none")