Replies: 1 comment
-
You could combine two plots sharing the same x scale: {
const topPlot = Plot.plot({
marginLeft: 120,
x: { axis: null, type:"band" },
marks: [Plot.lineY(data, { x: "week", y: "aval", z: "param" })]
});
const bottomPlot = Plot.plot({
marginLeft: 120,
x: topPlot.scale("x"), // reuses the same x scale
marks: [
Plot.cellX(time, {x: "week", y: "param", fill: "aval"})
]
});
return html`${topPlot}${bottomPlot}`;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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??
Current code
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, it'd be cool to be able to specify a y-axis for each mark maybe??
Pseudo-code
Any thoughts or help appreciated!!!
https://observablehq.com/d/650bd4ef81ea8b9f
Beta Was this translation helpful? Give feedback.
All reactions