library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point(aes(color = factor(cyl), shape = factor(gear)), size = 3) +
labs(
title = "Fuel Efficiency vs Horsepower",
subtitle = "Colored by number of cylinders, shaped by gear count",
x = "Horsepower (hp)",
y = "Miles Per Gallon (mpg)",
caption = "Data Source: mtcars dataset"
) +
theme_minimal()