Plot: cell mark vs rect mark

Hi,
I would like to make a figure with a cell grid based on categorical data.
The result should look something like this:

From the cell mark documentation

But I struggle to get the categorical data displayed on the x-axis.
What am I missing here (little example):

Plot.plot({
  x: { type: "band" },
  y: { type: "band" },
  marks: [Plot.cell(cat_data, { x: "favorite - color", y: "subject-id" })]
})

From this example notebook:

I would like to have a cell highlighted in the grid that corresponds to the “favorite color”.

Thanks for your help.

It’s the space in your CSV data – this was causing the field name of each row JavaScript object to have a space.

I sent your notebook a suggestion that fixes it:

2 Likes

Wow, great!
Thanks for your help

1 Like