Skip to content
Vega-Lite templates

Physics — Chart: Speed of Sound

Speed of sound in different media.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Speed of sound (m/s)",
  "data": {"values": [
    {"medium": "Air", "v": 343},
    {"medium": "Water", "v": 1480},
    {"medium": "Wood", "v": 3300},
    {"medium": "Glass", "v": 4540},
    {"medium": "Steel", "v": 5960}
  ]},
  "mark": "bar",
  "encoding": {
    "x": {"field": "medium", "type": "nominal", "sort": "y", "title": "Medium"},
    "y": {"field": "v", "type": "quantitative", "title": "speed (m/s)"},
    "color": {"field": "medium", "type": "nominal", "legend": null}
  }
}