Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotly: How to set line color?

Tags:

How can I set the color of a line in plotly?

import plotly.graph_objects as go from plotly.subplots import make_subplots   fig = make_subplots(rows=2, cols=1, subplot_titles=('Plot 1', 'Plot 2'))  # plot the first line of the first plot fig.append_trace(go.Scatter(x=self.x_axis_pd, y=self.y_1, mode='lines+markers', name='line#1'), row=1, col=1)  # this line should be #ffe476 

I tried fillcolor but that I suspected doesn't work because this is a simple line.

like image 537
Vader Avatar asked Oct 01 '19 16:10

Vader


1 Answers

You can add line=dict(color="#ffe476") inside your go.Scatter(...) call. Documentation here: https://plot.ly/python/reference/#scatter-line-color

like image 118
nicolaskruchten Avatar answered Oct 14 '22 22:10

nicolaskruchten