Skip to content

Instantly share code, notes, and snippets.

@yssymmt
Created August 12, 2023 13:52
Show Gist options
  • Save yssymmt/7dd0633abfff41654d69d661b23f8a06 to your computer and use it in GitHub Desktop.
Save yssymmt/7dd0633abfff41654d69d661b23f8a06 to your computer and use it in GitHub Desktop.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 600,
"height": 400,
"data": {
"format": {"type": "csv"},
"url": "boxplot_dat.csv"
},
"encoding": {"y": {"field": "変数名", "type": "nominal"}},
"layer": [
{
"mark": {"type": "rule", "strokeWidth": 5, "color":"#a9a9a9"},
"encoding": {
"x": {"field": "最小値", "type": "quantitative", "title": "値 (黒:平均値 | 白:中央値)"},
"x2": {"field": "最大値", "type": "quantitative"}
}
},
{
"mark": {"type": "bar", "size": 30, "opacity": 0.5, "color":"#008b8b"},
"encoding": {
"x": {"field": "第1四分位", "type": "quantitative"},
"x2": {"field": "第3四分位"},
"color": {"legend": null}
}
},
{
"mark": {"type": "tick", "color": "white", "size": 25},
"encoding": {
"x": {"field": "第2四分位", "type": "quantitative"}
}
},
{
"mark": {"type": "tick", "color": "black", "size": 25},
"encoding": {
"x": {"field": "平均値", "type": "quantitative"}
}
},
{
"mark": {"type": "tick", "color": "grey", "size": 15},
"encoding": {
"x": {"field": "最小値", "type": "quantitative"}
}
},
{
"mark": {"type": "tick", "color": "grey", "size": 15},
"encoding": {
"x": {"field": "最大値", "type": "quantitative"}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment