vega / altair

Declarative statistical visualization library for Python
https://altair-viz.github.io/
BSD 3-Clause "New" or "Revised" License
9.39k stars 795 forks source link

Empty plot when column name contains a dot `.` #3599

Closed Julian-J-S closed 2 months ago

Julian-J-S commented 2 months ago

What happened?

When trying to plot a chart the chart is empty if my column name contains a dot ..

I am new to altair since the great polars integration and this seems like a bug to me because for all other plotting libraries this works just fine.

alt.Chart(
    data=pl.DataFrame(
        {"x": [1, 2, 3], "y.1": [1, 4, 9]},
    )
).mark_line().encode(x="x", y="y.1")

With dot in column name

image

Without dot

image

What would you like to happen instead?

Normal plot to show

Which version of Altair are you using?

5.4.1

kgoodrick-uu commented 2 months ago

Special characters (including periods) must be escaped in Altair column names. See this section of the documentation for more information and suggested workarounds.