install.packages("cowplot")
library(cowplot)
mtcars1 <- ggplot(mtcars, aes(mpg, color = cyl)) + geom_freqpoly(binwidth = 1)+
theme_bw()+
labs(title = "Miles per Gallon by Cylinders",x = "Miles per Gallon",y = "Count",fill = "Cylinders")
mtcars2 <- ggplot(mtcars, aes(x = wt, y = mpg, col = cyl)) +
geom_point(size = 4, shape = 1, alpha = 0.6) +
labs(x = "Weight",y = "Miles per Gallon", color = "Cylinders")+
theme(legend.position = c(0.65, 0.85))
plot_grid(mtcars1, mtcars2, labels = "AUTO")