vegaEmbed({
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Temperature vs Hour",
"width": 500,
"height": 500,
"layer": [ {
"data": { "values": females },
"mark": {
"type": "line",
"stroke": "red",
},
"encoding": {
"y": {
"field": "hour",
"type": "quantitative",
"scale": {"domain": [5, 24]},
},
"x": {
"field": "temperature",
"type": "quantitative",
"scale": {"domain": [96.5, 99.5]},
},
"strokeOpacity": {
"field": "id",
"type": "nominal",
}
}
},{
"data": { "values": males },
"mark": {"type": "line", "stroke": "blue"},
"encoding": {
"y": {
"field": "hour",
"type": "quantitative",
"scale": {"domain": [5, 24]},
},
"x": {
"field": "temperature",
"type": "quantitative",
"scale": {"domain": [96.5, 99.5]},
},
"strokeOpacity": {
"field": "id",
"type": "nominal",
}
}
}, {
"data": { "values": nbs },
"mark": {"type": "line", "stroke": "black"},
"encoding": {
"y": {
"field": "hour",
"type": "quantitative",
"scale": {"domain": [5, 24]},
},
"x": {
"field": "temperature",
"type": "quantitative",
"scale": {"domain": [96.5, 99.5]},
},
"color": {
"field": "id",
"type": "nominal",
}
}
},
{
"data": { "values": temperatures },
"mark": { "type": "circle", "tooltip": {
"signal": "{'title': datum.id,'temperature': datum.temperature, 'gender': datum.gender, 'hour': datum.hour}"
}, },
"encoding": {
"y": {
"field": "hour",
"type": "quantitative",
"sort": "descending",
"scale": {"domain": [7, 24]},
},
"x": {
"field": "temperature",
"type": "quantitative",
},
"color": {
"field": "gender",
"type": "nominal",
"scale": {
"domain": ["f", "m", "not-specified"],
"range": ["#ff0000", "#0000ff", "#000000"]
}
},
}
},
{
"mark": {"type": "rule", "strokeDash": [2 ,2] },
"encoding": {
"x": { "datum": 99 },
"size": { "value": 1 },
"color": { "value": "red"}
}
}]
})