Arbitrary Background Coloring?

I’m plotting drug resistant mutations against all SNP mutations, and I like the look of it so far. I’d like to color the background of the plot so that it corresponds to gene boundaries and thought Plot.cell might be a way to do this, but each cell has a tiny value and is barely visible on the plot, so I’m not sure if I’m on the right track with this method. Is there a way to extend the width of the cells to the values I’ve specified in Plot.cell? Or is there a better way to do this? The actual colors are arbitrary and just need to be distinct enough to show where one gene ends and the next begins.

(Any explanation or pointers to documentation are also very welcome. Suggestions to clean up the axis title are also very appreciated!)

Drug Resistant Mutations / neurogenomics / Observable (observablehq.com)

Hello, welcome to the forum!
I’ve played a bit with your visualization code, making some “fixes” in terms of the axis and using the tickX mark instead of the Cell to show the boundaries (if i understand correctly).
I’ve also added a couple different versions below using more height:
https://observablehq.com/compare/7f52db35317ae876...ad1c6e5469d20e4c

Let me know if I can clarify the changes more!

1 Like

These are really sharp, thanks a lot. Is it possible to change the colors of the gene segments in the top example?

Btw, I really love the third plot with the nucleotides. I don’t know if this is the one we’ll present or not, but it’s so cool. Really neat way of visualizing it!