I have the problem that in my bar chart the bars and xlabels are not correctly aligned.
What do I have to change in my code to work on the alignment. I am not sure if it is the alignment of the bars or of the xlables.
def plot_model_parameters(df, title=""):
max_parameters = 250000
fig = px.bar(df,
x="architecture",
color= "architecture",
y='total_params',
labels={"architecture": "Model Architectures",
"total_params" : "Parameters",
},
#text_auto=".2s",
title=f"Total Parameters {title}",
barmode='group',
height=height,
template=template
)
fig.add_hline(y=max_parameters, line_width=2, line_dash="dash", line_color="blue", annotation_text=f"{max_parameters} Parameters",
annotation_position="top right")
fig.update_traces(width=bar_width)
fig.update_layout(width=width, height=height)
return fig
fig = plot_model_parameters(basemodels, title=" - Phase 1: Base Models")
fig.update_layout(showlegend=False)
fig.show()
Thanks for your support.