vega / altair

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

Ridgeline plot example broken ("Method Syntax" version) #3088

Closed thomascamminady closed 1 year ago

thomascamminady commented 1 year ago

I believe that the "Method Syntax" version of the ridgeline plot example (https://altair-viz.github.io/gallery/ridgeline_plot.html) might be broken in two ways.

1) Facet usage

The code for the ridgeline plot example contains this part

.facet(
    alt.Row('Month:T')
        .title(None)
        .header(labelAngle=0, labelAlign='right', format='%B')
)

But this renders the different facets as columns. This should be fixed to include the row keyword.

.facet(
    row=alt.Row('Month:T')
        .title(None)
        .header(labelAngle=0, labelAlign='right', format='%B')
)

2) Data not rendered

When I just copy the method syntax example, no data is rendered for me, the plot is empty and looks like this (I added the rowkeyword): image

I was able to identify this part as the issue:

 alt.X('bin_min:Q')
        .bin(True)
        .title('Maximum Daily Temperature (C)'),

If I replace this by

alt.X('bin_min:Q', bin='binned', title='Maximum Daily Temperature (C)'),

I get back the original plot that is shown in the "Attribute Syntax" example. I don't know what happens here though. This seems to have something to do with the binning?

thomascamminady commented 1 year ago

I saw that this was already addressed just minutes after posting. My apologies!

jonmmease commented 1 year ago

No problem, thanks for taking the time to let us know!