Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Add connecting line to scatter plot? #99

@nextgenusfs

Description

@nextgenusfs

Thanks for your work with plotly_express, it is generally easy to use. We've been trying to add a connecting line to a scatter plot and it doesn't seem like there is a setting to do this? There is the ability to add a trendline smoothed over the data, but we were actually just interested in something simpler. This is possible in plotly by specifying the 'mode' = 'lines+markers'. We were able to come up with a work around, although seems like providing access to the mode in the scatter function would be easier.

Work around is:

import plotly_express as px
iris = px.data.iris()
p = px.scatter(iris, x="sepal_width", y="sepal_length")
for i in range(0, len(p['data'])):
    p['data'][i]['mode'] = 'lines+markers'
p

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions