Skip to main content
100%

Creating a Scatter Plot with D3

✓ Published0🌍 Public
SShivaKarpe
Last edited Mar 6, 2022
Created on Mar 6, 2022

This example visualizes the Iris Dataset as a scatter plot, encoding petal length on the x-axis and petal width on the y-axis, with each point colored by species (green for setosa, yellow for versicolor, blue for virginica). It also reads sepal length and width as additional attributes for each circle, though these are not mapped to visual channels. Built with D3 v6, the code uses `d3.csv` to load data, `scaleLinear` and `extent` for scaling, and `axisLeft`/`axisBottom` for axes. Circles are appended via `selectAll` and `join`, rendered as SVG, with axis labels and a title manually positioned.

AI-generated description

A vanilla HTML implementation of a D3 scatter plot. Shows the Iris Dataset.

MIT Licensed

Similar vizzes