Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Y-axis autoscaling with x-range sliders in plotly

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.

like image 522
TOTORO Avatar asked May 11 '18 22:05

TOTORO


People also ask

What is range slider in Plotly?

In plotly, the range slider is a custom range-type input control. It allows selecting a value or a range of values between a specified minimum and maximum range. And the range selector is a tool for selecting ranges to display within the chart. It provides buttons to select pre-configured ranges in the chart.

How do you zoom in Plotly?

To zoom along only one axis, click and drag near the edges of either one of the axes. Additionally, to zoom-in along both the axes together, click and drag near the corners of both the axes.


1 Answers

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
)
like image 116
5md Avatar answered Oct 13 '22 17:10

5md