# Showlegend not working

**URL:** <https://community.plotly.com/t/showlegend-not-working/77530>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [August 7, 2023, 7:06am UTC](https://community.plotly.com/t/showlegend-not-working/77530 "2023-08-07T07:06:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![H4CK3R](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@H4CK3R](https://community.plotly.com/u/H4CK3R)\
**Post date:** [August 7, 2023, 7:06am UTC](https://community.plotly.com/t/showlegend-not-working/77530/1 "2023-08-07T07:06:42Z")

</div>

Hello,  
Showlegend in plotly.update\_layout() is not working . I had also tried layout.update, update(layout=dict()) methods too.  
I am using a dev container of custom tensorflow

```plaintext
fig = px.scatter(temp_na,x='date',y=[1]*temp_na.shape[0],title="Dates at which experiments have been carried out",color=year_col,color_continuous_scale=px.colors.qualitative.Plotly)
fig.update_layout(showlegend=False)
fig.update_yaxes(title="",zeroline=False,showticklabels=False)
fig.show()

```

 ![output](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/8/4/840ab077183eccd077346f27e64494fe8e73870a.png)

---

<div class="post-metadata">

**Author:** ![H4CK3R](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@H4CK3R](https://community.plotly.com/u/H4CK3R)\
**Post date:** [August 7, 2023, 7:17am UTC](https://community.plotly.com/t/showlegend-not-working/77530/2 "2023-08-07T07:17:15Z")

</div>

btw its working with graph\_objects. maybe its inconsistent when i give px a color argument?

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [August 7, 2023, 8:15am UTC](https://community.plotly.com/t/showlegend-not-working/77530/3 "2023-08-07T08:15:11Z")

</div>

Yes, the syntax is slightly different when using express / graph\_objects.

Plotly express is using graph\_objects under the hood. As for the color parameter: this creates different traces. You can see this if you plot the figure object: `print(fig.to_dict())`

What exactly are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![H4CK3R](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@H4CK3R](https://community.plotly.com/u/H4CK3R)\
**Post date:** [August 7, 2023, 1:06pm UTC](https://community.plotly.com/t/showlegend-not-working/77530/4 "2023-08-07T13:06:12Z")

</div>

I am trying to get rid of the legend(the continuous color column)

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [August 7, 2023, 1:31pm UTC](https://community.plotly.com/t/showlegend-not-working/77530/5 "2023-08-07T13:31:54Z")

</div>

Hey @H4CK3R , try this:

`fig.update_layout(coloraxis_showscale=False)`

If this does not work for you, please add the code + data (or equvalent data) to reproduce your plot.

---

<div class="post-metadata">

**Author:** ![H4CK3R](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@H4CK3R](https://community.plotly.com/u/H4CK3R)\
**Post date:** [August 7, 2023, 1:52pm UTC](https://community.plotly.com/t/showlegend-not-working/77530/6 "2023-08-07T13:52:06Z")

</div>

hurray…actually i proceeded to do in graph\_objects, but seeing this is just a simple solution i will use this. with this i can get rid of almost 6 line of code  
Thankyou very much mate  
best regards
