Skip to main content
100%

Observable Plot Scatterplot with Color

✓ Published0🌍 Public
CCurran Kelleher
Last edited Jan 22, 2024
Created on Jan 22, 2024

This example shows how penguin body mass and flipper length relate, with points colored by species using the Observable Plot library. It plots the penguins dataset from @curran/penguins, rendering dots with `Plot.dot` and mapping the `stroke` channel to the `species` field, while a legend appears via a `color` option. The chart is sized to its container and includes a grid and inset padding. The code also handles hot reloading by replacing the existing DOM node, and it overrides default figure margins in CSS.

AI-generated description

This example was ported from Observable: Scatterplot with color.

MIT Licensed

Similar vizzes