{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Gaussian distributions with different parameters",
"data": {
"sequence": {
"start": -5,
"stop": 5,
"step": 0.1,
"as": "x"
}
},
"transform": [
{
"calculate": "1 / (sqrt(2 * PI) * 1) * exp(-0.5 * pow((datum.x - 0) / 1, 2))",
"as": "y1"
},
{
"calculate": "1 / (sqrt(2 * PI) * 0.5) * exp(-0.5 * pow((datum.x - 0) / 0.5, 2))",
"as": "y2"
},
{
"calculate": "1 / (sqrt(2 * PI) * 1.5) * exp(-0.5 * pow((datum.x - 1) / 1.5, 2))",
"as": "y3"
}
],
"hconcat": [
{
"width": 250,
"height": 200,
"title": "Standard Normal (μ=0, σ=1)",
"mark": "line",
"encoding": {
"x": {
"field": "x",
"type": "quantitative",
"title": "x"
},
"y": {
"field": "y1",
"type": "quantitative",
"title": "Density"
},
"color": {
"value": "#004976"
}
}
},
{
"width": 250,
"height": 200,
"title": "Narrow Distribution (μ=0, σ=0.5)",
"mark": "line",
"encoding": {
"x": {
"field": "x",
"type": "quantitative",
"title": "x"
},
"y": {
"field": "y2",
"type": "quantitative",
"title": "Density"
},
"color": {
"value": "#7A0045"
}
}
},
{
"width": 250,
"height": 200,
"title": "Shifted and Wide (μ=1, σ=1.5)",
"mark": "line",
"encoding": {
"x": {
"field": "x",
"type": "quantitative",
"title": "x"
},
"y": {
"field": "y3",
"type": "quantitative",
"title": "Density"
},
"color": {
"value": "#486300"
}
}
}
]
}