gpt4 book ai didi

python - plotly 破折号: how to draw y axis in different ticks?

转载 作者:太空宇宙 更新时间:2023-11-03 21:11:48 25 4
gpt4 key购买 nike

例如,我创建了一个画图来显示某些产品的实际 sale_count 与我的模型预测的 sale_count 之间的百分比差异:

enter image description here

percentage_difference = (predict_value - real_value)/real_value

大多数点主要位于 0 ~ 1 。 (百分比0%~100%)我们知道,数据中总会存在一些异常值,其中一些可能超过 10 。

所以我想在以下位置显示绘图 y 轴:[-10, -5, -1, 0, 1, 5, 10]

500% ~ 1000% with length 1
100% ~ 500% with length 2
0% ~ 100% with length 3
0% ~ -100% with length 3
-100% ~ -500% with length 2
-500% ~ -1000% with length 1

但我在文档中没有看到示例。

最佳答案

用于手动轴范围

    layout = go.Layout(
xaxis=dict(
range=[2, 5]
),
yaxis=dict(
range=[2, 5]
)
)

了解更多信息https://plot.ly/python/axes/#setting-the-range-of-axes-manually

关于python - plotly 破折号: how to draw y axis in different ticks?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55016927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com