# Legendgroup without Subplots plotly

**URL:** <https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188>\
**Category:** 📊 Plotly Python\
**Created:** [January 27, 2020, 8:59pm UTC](https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188 "2020-01-27T20:59:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![0000](https://avatars.discourse-cdn.com/v4/letter/0/cab0a1/32.png) [@0000](https://community.plotly.com/u/0000)\
**Post date:** [January 27, 2020, 8:59pm UTC](https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188/1 "2020-01-27T20:59:40Z")

</div>

I created a dashboard, I usually use plotly express or go.Scatter. I need a legendgroup in them, but it seems that legendgroup is only available for subplots?

So far so good. I have multiple traces on each graph. If i use subplots there is no way to have same color in all graphs, if i use figure objects without subplots there is no way to use legendgroup ?

So both are not usefull for themself for me. Any ideas how to select data for multiple graphs if i click on the legend?

please help…any idea would be nice

---

<div class="post-metadata">

**Author:** ![mahdis](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@mahdis](https://community.plotly.com/u/mahdis)\
**Post date:** [January 27, 2020, 10:32pm UTC](https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188/2 "2020-01-27T22:32:02Z")

</div>

Hi there,

This tutorial might be helpful: [https://plot.ly/python/legend/#grouped-legend](https://plot.ly/python/legend/#grouped-legend)

---

<div class="post-metadata">

**Author:** ![0000](https://avatars.discourse-cdn.com/v4/letter/0/cab0a1/32.png) [@0000](https://community.plotly.com/u/0000)\
**Post date:** [January 27, 2020, 10:34pm UTC](https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188/3 "2020-01-27T22:34:21Z")

</div>

hi, no not really…i have multiple charts, not one chart. i have to update multiple figures by selecting one legend.

---

<div class="post-metadata">

**Author:** ![camramh](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@camramh](https://community.plotly.com/u/camramh)\
**Post date:** [September 16, 2020, 1:26am UTC](https://community.plotly.com/t/legendgroup-without-subplots-plotly/34188/4 "2020-09-16T01:26:58Z")

</div>

By using subplots you have to assign the same color to each trace with the same legendgroup. you must specify that color (e.g. ‘red’ or ‘rgb(155,144,36)’), without using a numerical array and colorscale. At least this way I could do it. (Sorry for the delay)
