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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.