plot = Plot.plot({
height: 500,
width: 640,
color: {
legend: true
},
marginLeft: 50,
marginBottom: 300,
y: {
domain: [0, 2]
},
x: {
nice: true,
tickRotate: -90,
label: ""
},
marks: [
Plot.barY(data, {
x: "case",
y: "value",
fill: "description"
}),
Plot.line(
[
{
x: cases[2],
y: ys.y2
},
{
x: cases[2],
y: 2
},
{
x: cases[3],
y: 2
},
{
x: cases[3],
y: ys.y3
}
],
{ x: "x", y: "y", strokeWidth: 3 }
),
Plot.arrow([{ x1: cases[3], x2: cases[3], y1: 2, y2: ys.y3 }], {
x1: "x1",
x2: "x2",
y1: "y1",
y2: "y2"
}),
Plot.text([{ x: cases[2], y: 2, text: "-1.5" }], {
x: "x",
y: "y",
text: "text",
fontSize: 22,
dx: 65,
dy: -11
})
]
})