【发布时间】:2020-08-28 23:36:56
【问题描述】:
我在 plotly.go 中创建了一个带有负维度和正维度的子弹图。但是,在绘制我的条时,它总是从 -1 开始。有没有办法将起点设置为零,所以它可以从那里在两个维度上对齐? 可重现的例子:
act = 0.123
avg = 0.13
before = 0.15
fig = go.Figure(go.Indicator(
mode="number+gauge+delta", value=act,
domain={'x': [0.1, 1], 'y': [0, 1]},
title={'text': "<b>S-Score</b>"},
delta={'reference': before},
gauge={
'shape': "bullet",
'tick0':0,
'axis': {'range': [-1, 1]},
'threshold': {
'line': {'color': "white", 'width': 2},
'thickness': 0.75, 'value': avg},
'steps': [
{'range': [-1, 0], 'color': "#ff6666"},
{'range': [0, 1], 'color': "#89ac76"}
],
'bar': {'color': "grey"}}))
【问题讨论】:
-
您是否有预期的图形输出,因为您不了解预期的输出图像?
-
预期输出与上图类似,但红色区域中没有条形。所以我希望它从中间开始并相应地向左或向右对齐。你知道有没有办法实现它?解决方法还是什么?
标签: python plotly data-visualization plotly-dash plotly.graph-objects