Skip to content

Instantly share code, notes, and snippets.

@keckelt
Created November 22, 2023 10:18
Show Gist options
  • Save keckelt/10e485dfd83c67b48cbd2aa2991982a5 to your computer and use it in GitHub Desktop.
Save keckelt/10e485dfd83c67b48cbd2aa2991982a5 to your computer and use it in GitHub Desktop.
Vega Lite Fill and Stroke Encoding
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A scatterplot showing body mass and flipper lengths of penguins.",
"data": {"url": "data/penguins.json"},
"transform": [{"sample": 30}],
"mark": "point",
"encoding": {
"x": {
"field": "Flipper Length (mm)",
"type": "quantitative",
"scale": {"zero": false}
},
"y": {
"field": "Body Mass (g)",
"type": "quantitative",
"scale": {"zero": false}
},
"strokeWidth": {"value": 4},
"stroke": {"field": "Species", "type": "nominal"},
"fill": {
"field": "Flipper Length (mm)",
"type": "quantitative",
"scale": {"scheme": "greys"}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment