# Scatter color not match with its legend

**URL:** <https://community.plotly.com/t/scatter-color-not-match-with-its-legend/70532>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [December 5, 2022, 10:15am UTC](https://community.plotly.com/t/scatter-color-not-match-with-its-legend/70532 "2022-12-05T10:15:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [December 6, 2022, 11:25am UTC](https://community.plotly.com/t/scatter-color-not-match-with-its-legend/70532/6 "2022-12-06T11:25:36Z")

</div>

Hi,

you can do so using the `selector` argument of `figure.update_traces()`

```python
fig.update_traces({'opacity': 0.5}, selector={'name': 'won'})
fig.update_traces({'opacity': 1.0}, selector={'name': 'lost'})

```

You could even change the size or marker color the same way:

```python
fig.update_traces({'opacity': 0.5}, selector={'name': 'won'})
fig.update_traces({'opacity': 1.0, 'marker':{'color':'blue','size':10}}, selector={'name': 'lost'})

```

![newplot (25)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/9/0/901c6a9a8e22e24089b6679f5a6bb35c13a62bb0.png)  
mrep traces

---

_[View the full topic](https://community.plotly.com/t/scatter-color-not-match-with-its-legend/70532)._
