1

There are two lines in the chart. Axis X-time, axis Y-depth of immersion. Depending on the time, a certain phase of work takes place. How to color the line for each phase in plotly? I didn’t find anything similar for the lines in the documentation, only for points.

# well_a_data.RelatedPhase
# well_b_data.RelatedPhase

well_a_trace = go.Scatter(
    x = well_a_data.Days,
    y = well_a_data.HoleDepth,
    mode = 'lines',
    name = well_a_name
)
well_b_trace = go.Scatter(
    x = well_b_data.Days,
    y = well_b_data.HoleDepth,
    mode = 'lines',
    name = well_b_name
)

graph

Jaymin
  • 2,879
  • 3
  • 19
  • 35

1 Answers1

0

Just insert line=dict(color="#00ff00") inside go.Scatter.

You can also use fig['data'][0]['line']['color']="#00ff00", or any other hex color code.

This has been described in more detail here.

vestland
  • 55,229
  • 37
  • 187
  • 305