Two Plots same x-axis, different y-axis (categorical and numeric)

Hi everyone!

I’m attempting to make a chart that’s a simple line plot on top of a heatmap that share the same x-axis. This simple enough to do as two separate plots using Plot but I’m not sure how to (1) best structure the data to (2) have a single plot with a y-axis that’s partially continuous and partially categorical - is this possible??

You’ll see in the notebook the y-axis is not in numerical order ascending upwards as would a normal numeric plot’s y-axis with 0 at the origin and ascending numbers.

Any thoughts or help appreciated!!!

https://observablehq.com/d/650bd4ef81ea8b9f

Hi Maya, would you mind moving your question to the github discussions? We’re trying to have the conversation in a single place. Also it might help if you could share a drawing of what you want to achieve. (For dual axis charts, see Plot: Dual axis chart / Observable | Observable; though in your case where you want to mix a band and a linear scale, it might be a bit more difficult.)

1 Like

Sorry about that! For reference conversation was moved here: two plots combined with the same x-axis and differing y-axis scale? · observablehq/plot · Discussion #2277 · GitHub

2 Likes