Altair: Using a symlog scale?

Created on 9 Aug 2018  Â·  8Comments  Â·  Source: altair-viz/altair

Is there any way to use a symlog scale for axes in Altair. If not would it be possible/relatively simple to add this in the future?

question vega-lite-related

Most helpful comment

Yes, for example:

import altair as alt
import pandas as pd

df = pd.DataFrame({
    'x': range(-50, 50),
    'y': range(100),
})

alt.Chart(df).mark_line().encode(
    alt.X('x', scale=alt.Scale(type='symlog')),
    alt.Y('y')
)

visualization (31)

All 8 comments

I don't think this is supported in Vega-Lite. It might be worth doing a feature request there.

@jakevdp - thanks. I'll do as you suggest and see if there's the possibility of adding this to Vega-Lite.

This appears to be supported now in Vega-Lite (see https://vega.github.io/vega-lite/docs/scale.html#symlog).

The current docs on the Vega-Lite website are for the version 3.0 pre-release. Once Vega-Lite 3 is released we will work to update altair to incorporate new features like this one.

Ah, got it. Sorry for the false alarm!
On Feb 28, 2019, 11:21 PM -0500, Jake Vanderplas notifications@github.com, wrote:

The current docs on the Vega-Lite website are for the version 3.0 pre-release. Once Vega-Lite 3 is released we will work to update altair to incorporate new features like this one.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Now that vega-lite v3 has been released has the symlog support been incorporated into Altair?

Yes, for example:

import altair as alt
import pandas as pd

df = pd.DataFrame({
    'x': range(-50, 50),
    'y': range(100),
})

alt.Chart(df).mark_line().encode(
    alt.X('x', scale=alt.Scale(type='symlog')),
    alt.Y('y')
)

visualization (31)

Excellent, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fischcheng picture fischcheng  Â·  4Comments

nielsmde picture nielsmde  Â·  4Comments

SuperShinyEyes picture SuperShinyEyes  Â·  3Comments

floringogianu picture floringogianu  Â·  3Comments

breadbaron picture breadbaron  Â·  4Comments