Inversing axes range and Responsive/Dynamic plots

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.

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.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/909cbfad-986e-49ba-81f1-6468cf073f4c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Alternatively, if you mean you want to flip the presentation of the axis, but keep auto-ranging, that is what the "flipped" property is for:

  ranges — Bokeh 3.3.2 Documentation

Thanks,

Bryan

···

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.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/909cbfad-986e-49ba-81f1-6468cf073f4c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

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!