I would like to set the width of each bar on the barplot based on the number of times the column chrom
has a particular value.
I am setting width bars to be a list of occurrences:
list_counts = plot_data.groupby('chrom')['gene'].count()
widthbars = list_counts.tolist()
Plotting the barplot as:
ax = sns.barplot(x = plot_data['chrom'], y = plot_data['dummy'], width=widthbars)
This gives me an error:
TypeError: bar() got multiple values for keyword argument 'width'
Is the width variable being set somewhere implicitly? How do I get the widths of each bar to be different?