In JupyterLab, I'm using the altair python library to create a bar graph where the x-axis is a log scale, but it's only returning an empty chart.
Plotting a regular bar graph works as expected and different scale types also work.
I've reviewed the troubleshooting doc at https://altair-viz.github.io/user_guide/troubleshooting.html#display-troubleshooting, tried different versions of JupyterLab, and double-checked my code, but haven't been able to work it out.
Here are the versions I am using:
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] JupyterLab 1.1.3 Altair 3.2.0 Pandas 0.25.1
Here's my code:
import altair as alt
import pandas as pd
df = pd.DataFrame(
[['L1', 2000],
['L2', 0],
['L3', 0],
['L4', 3000],
['L5', 101],
['L6', 100],
['L7', 99],
['L8', 250],
['L9', 770000]],
columns=['group', 'foos'])
chart = alt.Chart(df)
alt.Chart(df).mark_bar().encode(
alt.X('foos', scale=alt.Scale(type='log')),
y='group')