Can horsepower help explain a car’s fuel efficiency?
Our goal is to explore the relationship between engine power, vehicle weight, and fuel efficiency using an interactive visualization.
Created: October 24, 2026
The mtcars dataset contains measurements for 32 car
models from a 1974 Motor Trend magazine dataset.
Variables used
mpg: Miles per gallonhp: Gross horsepowerwt: Weight in 1,000 poundscyl: Number of cylindersThis dataset allows us to explore patterns between vehicle characteristics and fuel efficiency.
Hover over the points to explore individual cars. Zoom in, pan across the graph, and compare the different efficiency groups.
Bubble size represents vehicle weight. Colours distinguish cars above and below the dataset’s median MPG.
Horsepower and MPG correlation: -0.78
Weight and MPG correlation: -0.87
Median fuel efficiency: 19.2 MPG
How to interpret these results
An interactive visualization helps readers investigate the data themselves.
These features make the visualization more informative than a static image.
1. Horsepower and fuel efficiency
The correlation indicates the direction and strength of the relationship between horsepower and MPG in this dataset.
2. Vehicle weight matters too
The weight–MPG correlation helps us examine whether heavier vehicles tend to have lower fuel efficiency.
3. Relationships are not explanations
Engine design, transmission, cylinders, and other characteristics may also contribute to differences in fuel consumption.
This interactive exploration demonstrates how R and Plotly can be used to investigate relationships in a real dataset.
The analysis allows us to:
Main takeaway: Data visualization helps identify patterns, but further analysis is needed before drawing causal conclusions.
Methodology
mtcars, included with R.References
R Core Team. R: A Language and Environment for Statistical
Computing.
https://www.r-project.org/
R Documentation. Motor Trend Car Road Tests
(mtcars).
https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/mtcars.html
Plotly. Plotly for R Documentation.
https://plotly.com/r/
Questions?
An interactive data story created using R Markdown and Plotly.
October 24, 2026