# Trendline without Plotly Express

**URL:** <https://community.plotly.com/t/trendline-without-plotly-express/52384>\
**Category:** 📊 Plotly Python\
**Created:** [April 26, 2021, 8:37pm UTC](https://community.plotly.com/t/trendline-without-plotly-express/52384 "2021-04-26T20:37:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pzelnip](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@pzelnip](https://community.plotly.com/u/pzelnip)\
**Post date:** [April 26, 2021, 8:37pm UTC](https://community.plotly.com/t/trendline-without-plotly-express/52384/1 "2021-04-26T20:37:06Z")

</div>

Hi all, I currently have a scatter plot created with the `graph_objects` package. The code looks roughly like:

```auto
from plotly import graph_objects as go
from plotly.subplots import make_subplots

fig = make_subplots(rows=1, cols=1, subplot_titles=titles)

fig.add_trace(
    go.Scatter(
        name="Points",
        y=data["points"],
        x=data["start_time"],
        mode="lines+markers",
    ),
    col=1,
    row=1,
)

```

Where `data` is a plain Python dictionary that has two lists - one for a series of data points (integer values) and one for a list of timestamps. That is, it looks roughly like:

```auto
data = {
  "points": [5, 10, 13, .... more items ...],
  "start_time": [datetime(2021, 4, 10, 13, 5), datetime(2021, 4, 11, 3, 50), ... more items ...],
}

```

This works, and now I’d like to add a trendline to this chart, but all examples I seem to find require using Plotly Express, and I’d like to avoid using Plotly express on this project as it’d require me to pull in some other dependencies I don’t particularly want or need (Pandas being the biggest).

Is that possible, or is the only way to get a trendline on a scatter plat with Plotly express?
