Skip to main content
Public

Share visualization

Loading preview…

Reusable D3 Scatter Plot with symbols

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Reusable D3 Scatter Plot with symbols

0
Lliu yang
Last edited Nov 23, 2023
Created on Nov 23, 2023

This example demonstrates a reusable scatter plot implemented with D3 v7, visualizing the classic Iris dataset by mapping petal width and sepal length along the axes. The plot distinguishes the three Iris species using different SVG symbols, generated through `d3.symbol` and `d3.symbols`, with positions scaled by `d3.scaleLinear` and axes drawn via `d3.axisLeft` and `d3.axisBottom`. The chart is built as a custom function that accepts configurable width, height, margins, and accessor functions, and renders SVG elements after loading data asynchronously with `d3.csv`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed