Natasha
Natasha

Reputation: 1521

Specifying linetype in scatter plots of plotly

I would like to specify dotted linetype in scatter plot of plotly

import plotly.graph_objs as go

go.Scatter(
    x=df['x']
    y=df['y'],
    mode="lines+markers",
    marker=dict(size=7, color=color, symbol='circle-open'),
    fillcolor=color,
    name=f'{study[exp_names[i]]}_exp'
),

I could specify "lines+markers" in mode. But not sure how to specify the linetype.

Suggestions will be really helpful.

Upvotes: 0

Views: 5675

Answers (1)

Derek O
Derek O

Reputation: 19590

You can pass the argument line=dict(dash='dot') to go.Scatter (as shown in the documentation here):

go.Scatter(
    x=df['x']
    y=df['y'],
    mode="lines+markers",
    marker=dict(size=7, color=color, symbol='circle-open'),
    line=dict(dash='dot'),
    fillcolor=color,
    name=f'{study[exp_names[i]]}_exp'
),

Upvotes: 2

Related Questions