Plot.cell(
data,
Plot.group(
{ fill: "count", title: (t) => `${t.length} tweets` },
{
x: (d) => date(d.timestamp).getHours(),
y: (d) => date(d.timestamp).getDay()
}
)
).plot({
color: { scheme: "reds", legend: true, ticks: 5, nice: true },
x: { label: "time of day" },
y: {
tickFormat: (day) => ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][day]
}
})