Dana_Miles
Dana_Miles

Reputation: 429

Remove space for x- and y-label

I would like to remove the space under/next to the plot. I know I can rename the labels (e.g. clearing them with ''). unfortunately, there still is some space despite margins being 0 all around. How can I let the plot reach all the way to the bottom as well as the sides (just like it is atm with the top)? Thank you!

import plotly.express as px

dfs = px.data.tips()

fig = px.box(dfs, x="day", y="total_bill", color="smoker", labels={'day': ''})

fig.update_layout(
        margin=dict(l=0, r=0, t=0, b=0),
) 

fig.show()

Upvotes: 0

Views: 59

Answers (1)

Dana_Miles
Dana_Miles

Reputation: 429

I managed to solve the issue:

fig.update_xaxes(title_text=None)

Upvotes: 1

Related Questions