-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual-scale charts (bad idea)? #147
Comments
Discussion: #626 Examples: https://observablehq.com/@fil/dual-axis-bar-line-chart |
Just a quick note that while I do understand that dual scale charts can be badly used, I frequently find myself wishing for them. Eespecially when I'm looking at runtime data from a system that I've sensored up; even though "flow" and "conductivity" might have totally different scales, how they relate to each other at each moment is the thing I want to see. Doing that side by side or even above/below is hard to look at and be sure you're lined up on the same moment. |
It would be nice to have a few concrete examples to reason about. For example, if we have two scales, one might be linear and the other log. Or one might be ordinal and the other temporal? (The only thing they share, in fact, is a common range.) How would we indicate which scale is associated to which mark? Would a mark be able to use the two scales at once (for example to draw an arrow from (x1, y1) scaled with xa and ya to (x2, y2) scaled with xb and yb)? (Using a normalisation map transform might help to solve the problem above, maybe?) And there is the question of the dual axis: each axis would have to know what scale it represents, on which side it is, etc. |
I'm not sure if I'll answer your questions very well, but in the use case I had yesterday I was displaying two measurements (on Y axes) over time (X axis), for example, flow and conductivity mentioned above. This was extremely useful to identify certain effects as we modified the system. Concerning Y scales, maybe I'm being foolish, but why not let either scale be whatever one wants? For example, if I'm exploring effects on a system, it could be really valuable to have one scale be linear and the other log because the nature of those two measured items might be that different, but their relationship over time might still be worth seeing. I don't think one should be able to use both scales (like an arrow from one scale into the other). That doesn't make sense to me; but each mark having it's own scale makes pretty intuitive sense, I think. As far as the each axis knowing question, I'd thought that the Plot.lineY(output_draw_data, {
x: "timestamp",
y: "value",
stroke: "red",
curve: "step-after",
axis: "right",
}), I'm just riffing there... I know it's not that easy. But maybe calling out an Plot.plot({
y: {
"left": { type: "log", nice: true, line: true, color: green },
"right": { nice: false, line: true, color: orange }
}
} ...would be clear and easy enough? |
So I guess I'm thinking something that acts like Vega-Lite's |
Any further consideration of this lovely idea? :) (Guess who has some more dual-scale charts to make.) |
I don't see us supporting several y scales in the near future, but we certainly want to find ways to ease the pain of doing dual-axis charts now. I've added another alternative at the bottom of my notebook, showing how you can create a mark that return a D3 axis: |
FWIW: Despite Ms. Muth's recommendations/assertions ( https://blog.datawrapper.de/dualaxis/ ), dual-axis Pareto charts ( https://en.wikipedia.org/wiki/Pareto_chart ) offer high information-per-pixel. See: Avoiding the Dual Axis Chart: The Exceptions: https://policyviz.com/2022/10/06/avoiding-the-dual-axis-chart |
Vega-Lite has a notion of "independent" scales, as in https://vega.github.io/vega-lite/examples/layer_dual_axis.html |
Yes, I think we could do this by having a y1/y2 scale declared through a channel override. And then change implicit axes to draw axes for both scales. |
+1 as it's not always possible to convince stakeholders that there's "better" options |
Certainly something I would like to use ~ e.g.g body fat percentage against weight is one example where the scales don't match up, but you want to overlay them to observe correlation |
Any progress or hints (other than what's been documented above)? Pro account user asking, FWIW. :) |
@papakpmartin All progress is already shown above; we’re not hiding any secret progress! 😅 If you’re interested in this feature, please upvote by giving a 👍 reaction to the top post. |
Here’s another take on a dual-axis chart: https://observablehq.com/@observablehq/plot-dual-axis |
So apparently the author of that article responded on HN: (emphasis mine)
|
Ref. https://blog.datawrapper.de/dualaxis/
The text was updated successfully, but these errors were encountered: