Is it possible to re-enable autoscaling after setting the y_range of a figure?

I have an application where there are a bunch of graphs displayed with each initially using the default y scaling sets the y scale to match the data.
I can toggle that behavior off and set all the charts to use the same scale by setting the y_range on each of the figures. But now I want the option of going back to the original scaling behavior.

Is it possible to “remove” the y_range that I set or some other way to have the figure go back to automatically scaling the vertical axis (short of creating a whole new set of figures)?

Note that I don’t want to set a new/different y_range, but have each figure again calculate it.

I don 't know if this would work, but the
first thing that I would try would be to set
p.y_range = DataRange 1d()
(which is the au to-scaling type of
datarange).

Best,

Bird

···

On 5/11/16 11:21 AM, Jim Sharpe wrote:

    I have an application where there are a bunch of

graphs displayed with each initially using the default y scaling
sets the y scale to match the data.
I can toggle that behavior off and set all the charts to
use the same scale by setting the y_range on each of the
figures. But now I want the option of going back to the
original scaling behavior.

      Is it possible to "remove" the y_range that I set or some

other way to have the figure go back to automatically scaling
the vertical axis (short of creating a whole new set of
figures)?

      Note that I don't want to set a new/different y_range, but

have each figure again calculate it.

  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/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

https://groups.google.com/a/continuum.io/d/msgid/bokeh/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

Hi Sarah,

Thanks much for the helpful reply. That was exactly the kind of answer that I was hoping for. Unfortunately although that solution does appear to reset the scaling behavior back to automatic, I still am having trouble getting it to take effect on graphs that are currently displayed. The attached notebook demonstrates that it is possible to set a new y_range scale and also set it to autoscale, but apparently only for new copies of the graph. I thought this might be similar to an issue regarding updating Bokeh table data, so I tried adding the figure to curdoc, but that didn’t help. Do you have any idea how to modify the scale of a currently displayed graph?

ScaleTest.ipynb (115 KB)

···

On Wednesday, May 11, 2016 at 1:00:27 PM UTC-6, Sarah Bird wrote:

I don 't know if this would work, but the
first thing that I would try would be to set
p.y_range = DataRange 1d()
(which is the au to-scaling type of
datarange).

Best,

Bird

On 5/11/16 11:21 AM, Jim Sharpe wrote:

    I have an application where there are a bunch of

graphs displayed with each initially using the default y scaling
sets the y scale to match the data.
I can toggle that behavior off and set all the charts to
use the same scale by setting the y_range on each of the
figures. But now I want the option of going back to the
original scaling behavior.

      Is it possible to "remove" the y_range that I set or some

other way to have the figure go back to automatically scaling
the vertical axis (short of creating a whole new set of
figures)?

      Note that I don't want to set a new/different y_range, but

have each figure again calculate it.

  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/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io?utm_medium=email&utm_source=footer)[https://groups.google.com/a/continuum.io/d/msgid/bokeh/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" height="30px" width="150px">
    ](http://continuum.io)

Hi Jim,

First-up I didn’t realiz e you
were in the notebook. I had as sumed
you’re working wi th
the server.

I only really work in the notebook for prototyping so I’m no
expert (for example I’m not really
sure about how best to use push_notebook) ,
but the main thing that’s springing to mind.

                  What about just

sticking with DataRange1d and then switching between
setting start=3 | end=6 (or
whate ver
numbers) and start=None |
end=None
- whi ch
will cause DataRange1d to use
the auto
values?

                                The other

thing I 'd
say is that I always create a new/ seperate
plot for every one I’m viewing. So you may want a
“create_plot” method that returns a new plot if you want lots of copies of the sample plot.

If this doesn’t
help, if may be helpful to g ive us
something more concrete : I
tried this, execpted x, but
got
y.

Best,

Bird

···

On 5/11/16 6:16 PM, Jim Sharpe wrote:

Hi Sarah,

      Thanks much for the helpful reply.  That was exactly the

kind of answer that I was hoping for. Unfortunately although
that solution does appear to reset the scaling behavior back
to automatic, I still am having trouble getting it to take
effect on graphs that are currently displayed. The attached
notebook demonstrates that it is possible to set a new y_range
scale and also set it to autoscale, but apparently only for
new copies of the graph. I thought this might be similar to
an issue regarding updating Bokeh table data, so I tried
adding the figure to curdoc, but that didn’t help. Do you have
any idea how to modify the scale of a currently displayed
graph?

      On Wednesday, May 11, 2016 at 1:00:27 PM UTC-6, Sarah Bird

wrote:

I don 't know if this would work,
but the first thing that I wou ld try
would be to set p.y_range
= DataRange 1d()
(which is
the au to-scaling
type of datarange).

Best,

Bird

On 5/11/16 11:21 AM, Jim Sharpe wrote:

              I have an application where there are a

bunch of graphs displayed with each initially using
the default y scaling sets the y scale to match the
data.
I can toggle that behavior off and set all the
charts to use the same scale by setting the y_range
on each of the figures. But now I want the option
of going back to the original scaling behavior.

                Is it possible to "remove" the y_range that I set

or some other way to have the figure go back to
automatically scaling the vertical axis (short of
creating a whole new set of figures)?

                Note that I don't want to set a new/different

y_range, but have each figure again calculate it.

            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                 .

To view this discussion on the web visit


Sarah Bird
Developer, Bokeh

              [ ![Continuum
                  Analytics](https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000) ](http://continuum.io)

  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/90b18d26-92de-4cd0-8dc1-63e010b82ab0%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

[email protected]
https://groups.google.com/a/continuum.io/d/msgid/bokeh/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io.

            For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).

          [https://groups.google.com/a/continuum.io/d/msgid/bokeh/90b18d26-92de-4cd0-8dc1-63e010b82ab0%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/90b18d26-92de-4cd0-8dc1-63e010b82ab0%40continuum.io)

https://groups.google.com/a/continuum.io/d/optout

DataRanges probably need to be present on a plot from the beginning, at least currently. I did make a quick test doing:

    p = figure(plot_width=400, plot_height=400)
    p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
    p.x_range.start = 0
    p.x_range.end = 20
    p.y_range.start = 0
    p.y_range.end = 15

    show(p)

Then:

    p.x_range.start = None
    p.x_range.end = None
    p.y_range.start = None
    p.y_range.end = None
    push_notebook()

But unfortunately while I see an update, it updates to a blank plot. This use-case seems reasonable, but it had not happened to occur to me, and we've never demonstrated or tested for it. I believe it will require new development to make work. Can you file an issue on the GH issue tracker for this?

Thanks,

Bryan

···

On May 12, 2016, at 9:57 AM, Sarah Bird - Continuum <[email protected]> wrote:

Hi Jim,

First-up I didn't realize you were in the notebook. I had assumed you're working with the server.

I only really work in the notebook for prototyping so I'm no expert (for example I'm not really sure about how best to use push_notebook), but the main thing that's springing to mind.

What about just sticking with DataRange1d and then switching between setting start=3 | end=6 (or whatever numbers) and start=None | end=None - which will cause DataRange1d to use the auto values?

The other thing I'd say is that I always create a new/seperate plot for every one I'm viewing. So you may want a "create_plot" method that returns a new plot if you want lots of copies of the sample plot.

If this doesn't help, if may be helpful to give us something more concrete: I tried this, execpted x, but got y.

Best,

Bird

On 5/11/16 6:16 PM, Jim Sharpe wrote:

Hi Sarah,

Thanks much for the helpful reply. That was exactly the kind of answer that I was hoping for. Unfortunately although that solution does appear to reset the scaling behavior back to automatic, I still am having trouble getting it to take effect on graphs that are currently displayed. The attached notebook demonstrates that it is possible to set a new y_range scale and also set it to autoscale, but apparently only for new copies of the graph. I thought this might be similar to an issue regarding updating Bokeh table data, so I tried adding the figure to curdoc, but that didn't help. Do you have any idea how to modify the scale of a currently displayed graph?

On Wednesday, May 11, 2016 at 1:00:27 PM UTC-6, Sarah Bird wrote:
I don't know if this would work, but the first thing that I would try would be to set p.y_range = DataRange1d() (which is the auto-scaling type of datarange).

Best,

Bird

On 5/11/16 11:21 AM, Jim Sharpe wrote:

I have an application where there are a bunch of graphs displayed with each initially using the default y scaling sets the y scale to match the data.
I can toggle that behavior off and set all the charts to use the same scale by setting the y_range on each of the figures. But now I want the option of going back to the original scaling behavior.

Is it possible to "remove" the y_range that I set or some other way to have the figure go back to automatically scaling the vertical axis (short of creating a whole new set of figures)?

Note that I don't want to set a new/different y_range, but have each figure again calculate it.

--
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1f1c8372-dd25-42cd-b9e0-e30d61de4a1c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
Sarah Bird
Developer, Bokeh

--
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/90b18d26-92de-4cd0-8dc1-63e010b82ab0%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
Sarah Bird
Developer, Bokeh

--
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/c695cde8-7eac-3b48-e6c8-f1fe3b7c3d84%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks for the suggestions. Before we heard about the possibility of setting y_range to DataRange1d() we did try setting the entire range (as opposed to the ends) to None, but that didn’t work.

This application has up to 20 scatter (line) plots, each showing a single trace (waveform). The user can interactively move forward and back through the dataset displaying the data available a specific point in time. Originally we simply created the plots with the default autoscale and left it that way. However, the users indicated that they would prefer to see the relative amplitudes. This kind of data happens to look very similar at different scales but some graphs are typically many times larger in amplitude. So even though calculating a fixed vertical scale that matches the largest current dataset makes many of the other graphs appear basically as flat lines, that’s what they want to see. Even though the users wanted to see a “fixed” scale adjusted to the size of the data in the “largest” graph for all the charts, we though it would still be useful to allow them to occasionally enable autoscaling to see the details in the smaller signals, which is why we were looking for the capability of reverting to autoscaling after setting a specified range.

Although creating completely new graphs for each new data sample would technically work, I don’t think it’s a viable option. Creating new graphs takes many times longer than the time it takes to update the current ones and we typically show 20 at a time in a grid. Furthermore, the data being displayed is time series and there could be a potentially never ending set of scale changes. That would mean creating 20 new graphs every time the scale changed, which is basically every second.

I think the best option right now will be to revert to always autoscaling until a fix becomes available to allow us to dynamically change the range on an existing chart. I’ve created GH 4315 to track the issue.

···

On Wednesday, May 11, 2016 at 12:21:24 PM UTC-6, Jim Sharpe wrote:

I have an application where there are a bunch of graphs displayed with each initially using the default y scaling sets the y scale to match the data.
I can toggle that behavior off and set all the charts to use the same scale by setting the y_range on each of the figures. But now I want the option of going back to the original scaling behavior.

Is it possible to “remove” the y_range that I set or some other way to have the figure go back to automatically scaling the vertical axis (short of creating a whole new set of figures)?

Note that I don’t want to set a new/different y_range, but have each figure again calculate it.