I have the following plot:
<code>import plotly
import plotly.graph_objects as go
x1 = [ '2023-11-01','2023-11-02','2023-11-03','2023-11-04','2023-11-05',
'2023-11-06','2023-11-07','2023-11-08','2023-11-09','2023-11-10' ]
y1 = [ 0.97, 0.70, 0.90,-1.52,-1.97,-0.18,-2.03,-0.07,-1.31, 0.75 ]
y2 = [-1.29,-1.12, 0.49,-0.13,-1.39, 0.79, 0.80, 0.53, 0.94, 0.10 ]
y3 = [ 1.29, 0.12,-1.00, 1.13, 0.90,-1.22, 0.91, 1.53, 0.88,-0.17 ]
fig = go.Figure()
fig.add_trace(go.Scatter(x=x1, y=y1,mode='lines+markers', line_color='#8600ff',name='level 3'))
fig.add_trace(go.Scatter(x=x1, y=y2,mode='lines+markers', line_color="#23c6cc",name='level 1'))
fig.add_trace(go.Scatter(x=x1, y=y3,mode='lines+markers', line_color="#3176e0",name='level 2'))
fig.update_layout(showlegend=True,xaxis=dict(tickfont=dict(size=14, color='black')),)
fig.update_yaxes(
range=(-3, 3),
color='green'
)
fig.update_layout(
yaxis = dict(
tickmode='array', #change 1
tickvals = [4,3,2,1,0,-1,-2,-3,-4], #change 2
ticktext = ['4.0','3.0','2.0','1.0','Mean','1.0','2.0','3.0','4.0'], #change 3
))
fig.show()
</code>
<code>import plotly
import plotly.graph_objects as go
x1 = [ '2023-11-01','2023-11-02','2023-11-03','2023-11-04','2023-11-05',
'2023-11-06','2023-11-07','2023-11-08','2023-11-09','2023-11-10' ]
y1 = [ 0.97, 0.70, 0.90,-1.52,-1.97,-0.18,-2.03,-0.07,-1.31, 0.75 ]
y2 = [-1.29,-1.12, 0.49,-0.13,-1.39, 0.79, 0.80, 0.53, 0.94, 0.10 ]
y3 = [ 1.29, 0.12,-1.00, 1.13, 0.90,-1.22, 0.91, 1.53, 0.88,-0.17 ]
fig = go.Figure()
fig.add_trace(go.Scatter(x=x1, y=y1,mode='lines+markers', line_color='#8600ff',name='level 3'))
fig.add_trace(go.Scatter(x=x1, y=y2,mode='lines+markers', line_color="#23c6cc",name='level 1'))
fig.add_trace(go.Scatter(x=x1, y=y3,mode='lines+markers', line_color="#3176e0",name='level 2'))
fig.update_layout(showlegend=True,xaxis=dict(tickfont=dict(size=14, color='black')),)
fig.update_yaxes(
range=(-3, 3),
color='green'
)
fig.update_layout(
yaxis = dict(
tickmode='array', #change 1
tickvals = [4,3,2,1,0,-1,-2,-3,-4], #change 2
ticktext = ['4.0','3.0','2.0','1.0','Mean','1.0','2.0','3.0','4.0'], #change 3
))
fig.show()
</code>
import plotly
import plotly.graph_objects as go
x1 = [ '2023-11-01','2023-11-02','2023-11-03','2023-11-04','2023-11-05',
'2023-11-06','2023-11-07','2023-11-08','2023-11-09','2023-11-10' ]
y1 = [ 0.97, 0.70, 0.90,-1.52,-1.97,-0.18,-2.03,-0.07,-1.31, 0.75 ]
y2 = [-1.29,-1.12, 0.49,-0.13,-1.39, 0.79, 0.80, 0.53, 0.94, 0.10 ]
y3 = [ 1.29, 0.12,-1.00, 1.13, 0.90,-1.22, 0.91, 1.53, 0.88,-0.17 ]
fig = go.Figure()
fig.add_trace(go.Scatter(x=x1, y=y1,mode='lines+markers', line_color='#8600ff',name='level 3'))
fig.add_trace(go.Scatter(x=x1, y=y2,mode='lines+markers', line_color="#23c6cc",name='level 1'))
fig.add_trace(go.Scatter(x=x1, y=y3,mode='lines+markers', line_color="#3176e0",name='level 2'))
fig.update_layout(showlegend=True,xaxis=dict(tickfont=dict(size=14, color='black')),)
fig.update_yaxes(
range=(-3, 3),
color='green'
)
fig.update_layout(
yaxis = dict(
tickmode='array', #change 1
tickvals = [4,3,2,1,0,-1,-2,-3,-4], #change 2
ticktext = ['4.0','3.0','2.0','1.0','Mean','1.0','2.0','3.0','4.0'], #change 3
))
fig.show()
The code produces the graph I’d like, except I’d like to be able to alter the background as follows:
The hex codes for these colors are as follows:
<code>#eeeeee light purple
#f5f5f5 lighter purple
</code>
<code>#eeeeee light purple
#f5f5f5 lighter purple
</code>
#eeeeee light purple
#f5f5f5 lighter purple
Can you show me how to modify the above graph so that its background looks like the image?