Change the background colour and/or theme

Hi @trinityimma !

You can style the plot gridlines like this:

df = px.data.iris()
fig = px.bar(df, x="sepal_width", y="sepal_length", color="species")
fig.update_layout(
    plot_bgcolor='white'
)
fig.update_xaxes(
    mirror=True,
    ticks='outside',
    showline=True,
    linecolor='black',
    gridcolor='lightgrey'
)
fig.update_yaxes(
    mirror=True,
    ticks='outside',
    showline=True,
    linecolor='black',
    gridcolor='lightgrey'
)

You have more information about this process in this link: Axes in Python

3 Likes