Hide legend in plotly express

I have a scatteplot I’m trying to present, with lots of symbols and colors. This makes the default legend unreadable.
Is there a way to hide the legend (equivalent, or similar to showlegend=False when using traces and graph objects)?

Here’s my graphing line:
fig = px.scatter(df_revised, x='df_x', y = 'df_y', color = 'type', symbol = 'country', hover_data = ['id'], marginal_y="histogram", marginal_x="histogram")

Try fig.update_layout(showlegend=False) :slight_smile:


Nope, that’s not working.
AttributeError: 'ExpressFigure' object has no attribute 'update_layout'

Maybe .layout.update() works then

Yup, that worked. Thanks :slight_smile:

1 Like