Let me start by my understanding of dynamic plots. I have 5 source data each with its line plot in the same figure object.
If I change any of the source data, the graph automatically zooms in/out to fit all the points plotted into view.
Now I want to inverse my y axis for user intuition (y value is the rank, number 1 being the best).
I achieved this by having:
f.y_range.start=~some global maximum I have
f.y_range.end=~some global minimum I have
The code works, but the figure stops being “dynamic”. I feel that the initial y_range has set my curdoc in stone.
This is correct. Auto-ranging only functions when no explicit bounds are given. If you supply explicit bounds, Bokeh assumes you intend to override auto-ranging, and honors your request. I'm not sure what else could be done, auto-ranging and not-auto-ranging (i.e. using your user-set bounds) are mutually exclusive situations. If you are asking how to restore auto-ranging later, after the setting explicit bounds previously, then setting start/end to None should accomplish that. (Should -- I have not ever personally tested... If it does not, that is a bug and should prompt a GH issue).
Bryan
···
On Dec 26, 2017, at 16:07, Kenneth Tambuwun <[email protected]> wrote:
Let me start by my understanding of dynamic plots. I have 5 source data each with its line plot in the same figure object.
If I change any of the source data, the graph automatically zooms in/out to fit all the points plotted into view.
Now I want to inverse my y axis for user intuition (y value is the rank, number 1 being the best).
I achieved this by having:
f.y_range.start=~some global maximum I have
f.y_range.end=~some global minimum I have
The code works, but the figure stops being "dynamic". I feel that the initial y_range has set my curdoc in stone.
On Dec 26, 2017, at 16:18, Bryan Van de ven <[email protected]> wrote:
Hi,
This is correct. Auto-ranging only functions when no explicit bounds are given. If you supply explicit bounds, Bokeh assumes you intend to override auto-ranging, and honors your request. I'm not sure what else could be done, auto-ranging and not-auto-ranging (i.e. using your user-set bounds) are mutually exclusive situations. If you are asking how to restore auto-ranging later, after the setting explicit bounds previously, then setting start/end to None should accomplish that. (Should -- I have not ever personally tested... If it does not, that is a bug and should prompt a GH issue).
Bryan
On Dec 26, 2017, at 16:07, Kenneth Tambuwun <[email protected]> wrote:
Let me start by my understanding of dynamic plots. I have 5 source data each with its line plot in the same figure object.
If I change any of the source data, the graph automatically zooms in/out to fit all the points plotted into view.
Now I want to inverse my y axis for user intuition (y value is the rank, number 1 being the best).
I achieved this by having:
f.y_range.start=~some global maximum I have
f.y_range.end=~some global minimum I have
The code works, but the figure stops being "dynamic". I feel that the initial y_range has set my curdoc in stone.
Thank you very much Bryan! I thought I was at world’s end when I was presented with what seems like a mutually exclusive situation. Flipped did the trick!