Setting width of bars (linear and log)

Viewed 21

I have two sets of data that I want to compare by displaying it in plotly. With the basic setting I get incredibly thin lines that are not making any sense to read, so I tried to set up the width-parameter.

The result is kind of weird. I tried to use just width=1, but only the first bars were affected. So I set it for all the values and the result just gets weirder.

    fig.add_trace(go.Bar(x = df_orig["Records"].drop_duplicates().values.tolist(),
                         y = df_orig.groupby("Records")["File Size"].sum(),
                         offset = 0.0005,
                         width = [1.5] * len(df_orig["Records"].drop_duplicates()),
                         name = 'Original',
                         text= df['File Size']))

    fig.add_trace(go.Bar(x = df_compr["Records"].drop_duplicates().values.tolist(),
                         y = df_compr.groupby("Records")["File Size"].sum(),
                         width = 10,
                         name = 'Compressed',
                         text= df['File Size']))

This code does essentially what it should (I think, I can't properly read the values on the plot). However I can't make sense of how to set the width of the bars:

enter image description here

When changing to the Logarithmic Plot the bars are behaving very differently. enter image description here

What am I doing wrong? Is there an explanation for this behavior?

0 Answers
Related