# Hide legend in plotly express

**URL:** <https://community.plotly.com/t/hide-legend-in-plotly-express/27512>\
**Category:** 📊 Plotly Python\
**Created:** [August 20, 2019, 8:45pm UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512 "2019-08-20T20:45:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![guy](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@guy](https://community.plotly.com/u/guy)\
**Post date:** [August 20, 2019, 8:45pm UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512/1 "2019-08-20T20:45:37Z")

</div>

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")`

---

<div class="post-metadata">

**Author:** ![LordFinzenz](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@LordFinzenz](https://community.plotly.com/u/LordFinzenz)\
**Post date:** [August 21, 2019, 8:51am UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512/2 "2019-08-21T08:51:14Z")

</div>

Try fig.update\_layout(showlegend=False) 🙂

---

<div class="post-metadata">

**Author:** ![guy](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@guy](https://community.plotly.com/u/guy)\
**Post date:** [August 21, 2019, 12:46pm UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512/3 "2019-08-21T12:46:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LordFinzenz](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@LordFinzenz](https://community.plotly.com/u/LordFinzenz)\
**Post date:** [August 21, 2019, 1:11pm UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512/4 "2019-08-21T13:11:23Z")

</div>

Maybe .layout.update() works then

---

<div class="post-metadata">

**Author:** ![guy](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@guy](https://community.plotly.com/u/guy)\
**Post date:** [August 21, 2019, 1:14pm UTC](https://community.plotly.com/t/hide-legend-in-plotly-express/27512/5 "2019-08-21T13:14:07Z")

</div>

Yup, that worked. Thanks 🙂
