# How to create scatter plot with one overall trend line and then individual trend lines for individual groupings

**URL:** <https://community.plotly.com/t/how-to-create-scatter-plot-with-one-overall-trend-line-and-then-individual-trend-lines-for-individual-groupings/56623>\
**Category:** 📊 Plotly Python\
**Created:** [September 14, 2021, 9:21pm UTC](https://community.plotly.com/t/how-to-create-scatter-plot-with-one-overall-trend-line-and-then-individual-trend-lines-for-individual-groupings/56623 "2021-09-14T21:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![python](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@python](https://community.plotly.com/u/python)\
**Post date:** [September 14, 2021, 9:21pm UTC](https://community.plotly.com/t/how-to-create-scatter-plot-with-one-overall-trend-line-and-then-individual-trend-lines-for-individual-groupings/56623/1 "2021-09-14T21:21:48Z")

</div>

First I wanted to make the groupings different colors with 1 overall trend line, but the variable was numeric (thus making the colors continuous) so I changed it to a string (so that the colors would be discrete). As a result, I got a bunch of separate trend lines instead of an overall one.

Is it possible to make it so that there’s one overall trend line for the chart (still having the different colors for the grouping), and then have a corresponding trend line when clicking on an individual color/group?

Let me know If clarification or any other info is needed.

What I have now:

 ![Screen Shot 2021-09-14 at 5.17.23 PM](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/a/f/af22cc2163bd983bcda41c4ee7510d6575404c43.png)

The data set:

 ![Screen Shot 2021-09-14 at 5.22.37 PM](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/5/3/534351545d750dc059bbf9dd502b24a046ab0ea0.png)
