Plot.plot({
width: 500,
height: 390,
marginLeft: 62,
marginRight: 18,
marginTop: 34,
marginBottom: 54,
style: {
fontFamily: "Fira Sans, Helvetica, sans-serif",
fontSize: "13px"
},
color: {
domain: ["Rest frame", "Observer frame"],
range: ["#50a96d", "#ef7c3b"],
legend: true
},
x: {
type: "log",
domain: [doppler_config.minFlux, doppler_config.plotMaxFlux],
ticks: [1, 10, 100],
label: "Flux density"
},
y: {
type: "log",
domain: [1, 12000],
ticks: [1, 10, 100, 1000, 10000],
label: "Count in each flux bin"
},
marks: [
Plot.rectY(doppler_histograms.bars, {
x1: "x0",
x2: "x1",
y1: 1,
y2: "count",
fill: "series",
fillOpacity: 0.22,
inset: 0
}),
Plot.line(doppler_histograms.outlines, {
x: "x",
y: "count",
z: "series",
stroke: "series",
curve: "step-after",
strokeWidth: 2.8
}),
Plot.ruleX([doppler_config.fluxCut], {
stroke: "#222",
strokeDasharray: "5,4",
strokeOpacity: 0.65
}),
Plot.ruleY([1], {
stroke: "#000",
strokeWidth: 2.8
}),
Plot.ruleX([doppler_config.minFlux], {
stroke: "#000",
strokeWidth: 2.8
}),
Plot.text(
[{ x: doppler_config.fluxCut, label: "Flux cut" }],
{
x: "x",
text: "label",
frameAnchor: "top",
dy: 8,
dx: 5,
textAnchor: "start",
fill: "#222"
}
)
]
})