pythonplotlyplotly-pythonplotly.graph-objects

Plotly - multiple labels on x axis


I have a dataset with columns for week and month respectively, and I would like to plot variable in time using both week and month as labels.

Can something like this be done with plotly in python?

enter image description here

Thanks, Lukas


Solution

  • Please try something as below:

    fig = go.Figure(data=[
            go.Bar(name='Type', x=[tuple(df['Month']), tuple(df['Week'])],
                   y=list(df['Value'])),
        ])