I have a dataset:
I want to visualise this dataset in a stacked-and-grouped bar chart using Plotly. Unfortunately, Plotly does not have this type of charts yet, but there is this workaround that I tried.
My code:
sv_clusters = ["cluster_1", "cluster_2", "cluster_3", "cluster_4", "cluster_5", "cluster_6", "cluster_7"]
sv_data = sv_data[["Population", "Sample_name"] + sv_clusters]
for r in sv_clusters:
fig.add_trace(
go.Bar(
x=[sv_data.Population, sv_data.Sample_name],
y=sv_data[r],
name=r,
marker=dict(
line_width=0)),
)
fig.update_layout(
template="simple_white",
xaxis=dict(title_text=None),
yaxis=dict(title_text="fraction"),
width=2000,
bargap=0,
title='Alles',
barmode="stack",
Now my plot looks like this:
I want to remove the x-label ticks, since it clutters the chart (sample names not the population names). So I tried showticklabels=False
, which resulted in this:
Which removes all x-axis labels.
How do I remove the sample name tick labels?