Plot y-axis Dynamic Change When extra_y_ranges used

Using Bokeh 0.7.1 (excited to check out 0.8!)

I’m creating some plots with twin-axis, and noticed that when I set plot.y_axis = None, but add in additional twin_axis, the underlying y_axis doesn’t dynamically change to fit the data that I’m streaming in via tcp. This is in contrast to plots which only have plot.y_axis = None, where the plot’s axis auto-resize to fit the data display. Is there a way to, in a way, isolate the underlying y-axis from the effects of the extra axis?

Also, I noticed that I’m not able to add multiple twin axis on one side. For instance, when I use something like:

plot.extra_y_ranges[‘y2’] = Range1d(start = 10, end = 20)

plot.extra_y_ranges[‘y3’] = Range1d(start = 10, end = 20)

plot.add_layout(LinearAxis(y_range_name = ‘y2’, axis_label = ‘y2’), ‘right’)

plot.add_layout(LinearAxis(y_range_name = ‘y3’, axis_label = ‘y3’), ‘left’)

the plot that displays only shows the axis, but no data (as in the x axis is of length 0). Is there a way to stack extra axis? Thanks!

Hi ading,

If you are using the bokeh.plotting "glyphs" interface to create plots, then it creates "DataRange" range objects for the plot by default. Right now DataRanges operate by "enveloping" a prescribed set of columns from the data source as a simple way to automatically set the bounds. My best guess is that you are adding glyphs and data sources that this default DataRange does not know about, and so does not try to update. I am also not certain that having multiple DataRanges together would currently work. They might "compete" to set the range in a bad way. Eventually, the plan is for DataRange objects to query the renderers for their exact preferred bounds which is a more robust approach, but it will still require some coordination in the multiple range/axis case. I am not sure about an ETA for this, I would hope by 0.9 or so. In the mean time I am afraid your best option is to update the ranges manually. There are a few ways this might work, it would depend on how you are updating the data (using a bokeh-server? pulling with some custom JS? etc.)

I'm not sure I follow the last bit. It should definitely be possible to stack axes on one side (the example in the examples folder does this). If you are experiencing something different please submit an issue on the GH issue tracker with a minimal complete code example to reproduce the problem and preferably a screenshot as well.

Thanks,

Bryan

···

On Feb 24, 2015, at 4:16 PM, [email protected] wrote:

Using Bokeh 0.7.1 (excited to check out 0.8!)

I'm creating some plots with twin-axis, and noticed that when I set plot.y_axis = None, but add in additional twin_axis, the underlying y_axis doesn't dynamically change to fit the data that I'm streaming in via tcp. This is in contrast to plots which only have plot.y_axis = None, where the plot's axis auto-resize to fit the data display. Is there a way to, in a way, isolate the underlying y-axis from the effects of the extra axis?

Also, I noticed that I'm not able to add multiple twin axis on one side. For instance, when I use something like:

plot.extra_y_ranges['y2'] = Range1d(start = 10, end = 20)
plot.extra_y_ranges['y3'] = Range1d(start = 10, end = 20)
plot.add_layout(LinearAxis(y_range_name = 'y2', axis_label = 'y2'), 'right')
plot.add_layout(LinearAxis(y_range_name = 'y3', axis_label = 'y3'), 'left')

the plot that displays only shows the axis, but no data (as in the x axis is of length 0). Is there a way to stack extra axis? Thanks!

--
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/9fbc7aba-60d9-4ae0-9c97-47e51cf513c7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

Setting up the multiple range updating would definitely be tricky. My extra axis are hard-coded in, so data wrt to those are fixed, but the data that has non-specified y_range_name and y_axis_label would ideally adjust properly. This is currently a problem because my data is immediately flying off the graphing area. I’m streaming the data in using bokeh-server via a tcp socket–do you have a suggestion on what you think might be the best way to do the manual update?

On the second part, I’m having trouble stacking more than one extra axis on each side. I’ll go ahead and put in an issue on the GH issue tracker with some more detail.

Thanks,

Amy

···

On Tuesday, February 24, 2015 at 11:57:17 PM UTC-5, Bryan Van de ven wrote:

Hi ading,

If you are using the bokeh.plotting “glyphs” interface to create plots, then it creates “DataRange” range objects for the plot by default. Right now DataRanges operate by “enveloping” a prescribed set of columns from the data source as a simple way to automatically set the bounds. My best guess is that you are adding glyphs and data sources that this default DataRange does not know about, and so does not try to update. I am also not certain that having multiple DataRanges together would currently work. They might “compete” to set the range in a bad way. Eventually, the plan is for DataRange objects to query the renderers for their exact preferred bounds which is a more robust approach, but it will still require some coordination in the multiple range/axis case. I am not sure about an ETA for this, I would hope by 0.9 or so. In the mean time I am afraid your best option is to update the ranges manually. There are a few ways this might work, it would depend on how you are updating the data (using a bokeh-server? pulling with some custom JS? etc.)

I’m not sure I follow the last bit. It should definitely be possible to stack axes on one side (the example in the examples folder does this). If you are experiencing something different please submit an issue on the GH issue tracker with a minimal complete code example to reproduce the problem and preferably a screenshot as well.

Thanks,

Bryan

On Feb 24, 2015, at 4:16 PM, [email protected] wrote:

Using Bokeh 0.7.1 (excited to check out 0.8!)

I’m creating some plots with twin-axis, and noticed that when I set plot.y_axis = None, but add in additional twin_axis, the underlying y_axis doesn’t dynamically change to fit the data that I’m streaming in via tcp. This is in contrast to plots which only have plot.y_axis = None, where the plot’s axis auto-resize to fit the data display. Is there a way to, in a way, isolate the underlying y-axis from the effects of the extra axis?

Also, I noticed that I’m not able to add multiple twin axis on one side. For instance, when I use something like:

plot.extra_y_ranges[‘y2’] = Range1d(start = 10, end = 20)

plot.extra_y_ranges[‘y3’] = Range1d(start = 10, end = 20)

plot.add_layout(LinearAxis(y_range_name = ‘y2’, axis_label = ‘y2’), ‘right’)

plot.add_layout(LinearAxis(y_range_name = ‘y3’, axis_label = ‘y3’), ‘left’)

the plot that displays only shows the axis, but no data (as in the x axis is of length 0). Is there a way to stack extra axis? Thanks!


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/9fbc7aba-60d9-4ae0-9c97-47e51cf513c7%40continuum.io.

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