# Load dataset
data(mtcars)
# Load ggplot2
library(ggplot2)
# Scatter plot: mpg vs hp
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point(color = "blue", size = 2) +
labs(
title = "Relationship Between Horsepower and Fuel Efficiency",
x = "Horsepower (hp)",
y = "Miles Per Gallon (mpg)"
) +
theme_minimal()
There is a negative relationship between horsepower and miles per gallon. As horsepower increases, fuel efficiency generally decreases.