plot1 = Plot.plot({
width: width,
height: width*dummyHeight/dummyWidth,
padding: 0,
grid: true,
inset: -20,
x: {label: null, tickSize: 0, tickFormat: null},
y: {label: null, tickSize: 0, tickFormat: null},
color: { domain: d3.range(10)},
marks: [
Plot.cell(codeMatrix2.flat(), {
x: (_,i) => i % N,
y: (_,i) => Math.floor(i / N),
fill: d => d === missingCode ? null : (d == waterCode) ? 0 : (1 + d%9),
inset: -.5
})
]
})