使用x范围滑块在Y轴上自动缩放 [英] Y-axis autoscaling with x-range sliders in plotly

查看:182
本文介绍了使用x范围滑块在Y轴上自动缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Afaik,使用x-range滑块时,y轴无法自动缩放.相对于整个x范围的y值选择Y范围,并且在放大后不会更改.这在波动时期的烛台图表中尤其令人讨厌.使用x-range滑块放大时,实际上可以获得平坦的烛台,因为它们的波动仅覆盖初始范围的一小部分.经过研究后,似乎已经取得了一些进展: https://github.com /plotly/plotly.js/pull/2364 .有谁知道plotly.py是否有可行的解决方案? 谢谢您的宝贵时间.

Afaik, y-axis cant be made to auto scale when using x-range sliders. Y range is chosen with respect to the y values of the whole x range and does not change after zooming-in. This is especially annoying with candlestick charts in volatile periods. When you zoom-in using x-range slider, you essentially get flat candlesticks as their fluctuations only cover a very small part of the initial range. After doing some research it seems that some progress has been made here: https://github.com/plotly/plotly.js/pull/2364. Anyone knows if there is a working solution for plotly.py ? Thanks for your time.

推荐答案

如果有帮助,我正在yaxis上使用fixedrange = False,以便能够手动缩放并使窗口适应合适的y范围:

If it can help, I am using fixedrange = False on yaxis, to be able to zoom manually and adapt the window to the suited y range:

yaxis = dict(
     fixedrange = False
)

这篇关于使用x范围滑块在Y轴上自动缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆