Faceted Density Plot

View this example in the online editor

Vega-Lite JSON Specification

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "width": 300,
  "height": 50,
  "data": {"url": "data/iris.json"},
  "mark": "area",
  "transform": [
    {
      "fold": [
        "petalWidth",
        "petalLength",
        "sepalWidth",
        "sepalLength"
      ],
      "as": ["organ", "value"]
    },
    {
      "density": "value",
      "bandwidth": 0.3,
      "groupby": ["organ"]
    }
  ],
  "encoding": {
    "x": {
      "field": "value",
      "type": "quantitative"
    },
    "y": {
      "field": "density",
      "type": "quantitative"
    },
    "row": {
      "field": "organ",
      "type": "nominal"
    }
  }
}