Altair: multiple axis support?

Created on 30 Aug 2016  Â·  7Comments  Â·  Source: altair-viz/altair

All 7 comments

In Vega-Lite 2.0 release, you will be able to do dual axis.

Multiple axes (more than 2) can be supported; however, we have not implemented it and do not have plan to do so yet since it's generally not a good design. (For example, even the plotly example only shows that you can do it but it doesn't show a case where you really should do it.)

Thanks @kanitw – and @denfromufa, in case it's unclear: Altair doesn't provide any of its own plot features, it simply wraps Vega-Lite with a Python API. So once multiple axis support is released in Vega-Lite, we'll push a new release of Altair that will give access to it.

@kanitw if multiple axis is not good design, what is the alternative? We regularly view multiple physical variables simulated either over length or time and I do not see any alternative.

@denfromufa Great question! Multi-axis plots can be misleading due to potentially different scale units -- in some cases one can adjust the scales of one or more axes to create vastly different perceptual patterns for the same data. (Another example: line crossings are perceptually salient, but may not have any significance in a multiple-axis plot.) Where possible, transforming data into common units (e.g., via an appropriate standardization, often data-dependent) can help, and then one only needs a single axis to summarize the shared scale. More generally, breaking up data into multiple plots is often preferable to overplotting in a single display, particularly when overlapping layers leads to occlusion.

That said, these design discussions may be a bit orthogonal to issue reporting for Altair, and so perhaps better conducted elsewhere!

I'm going to close this as it's more of a Vega-Lite discussion than an Altair discussion.

FWIW, Vega-Lite's layer operator will allow dual axis.

Here is an example spec: https://github.com/vega/vega-lite/blob/master/examples/specs/layer_bar_dual_axis.vl.json

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtbaker picture jtbaker  Â·  3Comments

tonylee3399 picture tonylee3399  Â·  3Comments

maxgerma picture maxgerma  Â·  3Comments

DentonGentry picture DentonGentry  Â·  3Comments

mroswell picture mroswell  Â·  4Comments