Skip to main content
100%

Scatterplot: Horsepower and MPG in D3

✓ Published1🌍 Public
Kkfhujosefsson@dons.usfca.edu
Last edited Feb 18, 2025
Created on Jan 28, 2025

This scatterplot shows the relationship between horsepower and miles per gallon (MPG) for a set of cars. It displays each car as a circle, with MPG on the x-axis and horsepower on the y-axis. Using d3.csv, it loads car data from a remote GitHub gist, converts the string values to numbers, and maps them to linear scales via d3.scaleLinear. The visualization renders circles as SVG elements, styled with CSS hover effects, and includes labeled axes and a title generated with d3-axis and SVG text.

AI-generated description
MIT Licensed

Similar vizzes