我正在尝试通过情节创建四个笛卡尔象限。我无法将刻度移动到 x=0 和 y=0。我无法弄清楚如何。
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4], y=[-4,-4, -4 ,-4, -4],fill='tozeroy', name = 'Cost Saving', mode = 'lines',line=dict(width=0.5, color='rgb(144,238,144,0.2)'), opacity = 0.2))
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4], y=[4, 4, 4, 4, 4], fill='tozeroy', name = 'Highly Cost Effective', mode = 'lines',line=dict(width=0.5, color='rgb(173,216,230,0.1)'), opacity = 0.2)) # fill down to xaxis
fig.add_trace(go.Scatter(x=[0, -1, -2, -3, -4], y=[-4,-4, -4 ,-4, -4],fill='tozeroy', name = 'Dominated', mode = 'lines',line=dict(width=0.5, color='rgb(211,211,211,0.05)'), opacity = 0.2)) # fill to trace0 y
daly = [ 2,3.3, 1, 0.7, 2.3]
cost = [ 1,-0.3, 2, -0.7, 3.3]
name = ['A', 'B', 'C', 'D', 'E']
fig.add_trace(go.Scatter(x=daly, y = cost, mode='markers+text', text = name,textposition='top right', marker=dict(size=10, color='black'), showlegend= False))
fig.update_layout(yaxis_range=(-2, 4), xaxis_range=(-1,4))
fig.update_xaxes(zeroline=True, zerolinewidth=2, zerolinecolor='Black')
fig.update_yaxes(zeroline=True, zerolinewidth=2, zerolinecolor='Black')
fig.show()
但是,我希望创建类似下面的内容,即移动到 x,y 的刻度(在 powerpoint 中编辑,并以红色边框突出显示)