Plot.plot({
marks: [
Plot.frame(),
Plot.lineY(aapl, {
x: "date",
y: "close",
stroke: (d) => d.date.getFullYear(),
curve: "step"
})
],
facet: { data: aapl, x: (d) => d.date.getFullYear() },
x: {
transform: (d) => d3.utcDay.offset(d, (2000 - d.getUTCFullYear()) * 365.24),
tickFormat: ((a) => (d) => a(d.getUTCMonth()))(Plot.formatMonth()),
ticks: 4
},
width
})