xlim() and ylim() ?

Hi !

Is there any way of obtaining the limits of the visible area of the plot, just like matplotlib’s xlim() and ylim() methods?

The use case would be to make a figure, let the user play with it (e.g. zoom, pan), and then let him identify a region of interest that would be saved for later (e.g. via a buttom).

It is obviously used already, e.g. in the Previous/Save tool, but it is not clear to me whether all this exists on the Java side only or whether this can be easily accessible from python?

Take this simple code, even without moving/zooming:

import numpy as np

import bokeh.plotting as bplt

x = np.random.randn(100)

y = np.random.randn(100)

bplt.output_server(‘test_interactivity’)

fig = bplt.figure(plot_width=600, plot_height=600, tools=‘pan,wheel_zoom’)

plot = bplt.scatter(x=x, y=y)

bplt.show()

I could not figure out how to determine the range of the plot as shown to the user.

plot.x_range’s start and end property are None (only the padding is defined)

bplt.xaxis()[0].bounds is ‘auto’

Many thanks for you help!

M.

Hi Maheuh,

This information really is only guaranteed to be preset in the javascript. In principal this information could be communicated back using the bokeh-server, or it might also be possible to plumb something together in the ipython notebook. Neither of these is currently implemented, however, some work to improve and refactor tools and events is planned which will probably make these ideas more feasible.

Thanks,

Bryan

···

On Aug 6, 2014, at 5:30 PM, [email protected] wrote:

Hi !

Is there any way of obtaining the limits of the visible area of the plot, just like matplotlib's xlim() and ylim() methods?
The use case would be to make a figure, let the user play with it (e.g. zoom, pan), and then let him identify a region of interest that would be saved for later (e.g. via a buttom).
It is obviously used already, e.g. in the Previous/Save tool, but it is not clear to me whether all this exists on the Java side only or whether this can be easily accessible from python?

Take this simple code, even without moving/zooming:

import numpy as np
import bokeh.plotting as bplt
x = np.random.randn(100)
y = np.random.randn(100)
bplt.output_server('test_interactivity')
fig = bplt.figure(plot_width=600, plot_height=600, tools='pan,wheel_zoom')
plot = bplt.scatter(x=x, y=y)
bplt.show()

I could not figure out how to determine the range of the plot as shown to the user.
plot.x_range's start and end property are `None` (only the padding is defined)
bplt.xaxis()[0].bounds is 'auto'

Many thanks for you help!
M.

--
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/c7d486a6-9f6d-43d2-867a-f878f60774b0%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

Ok, thanks, I’ll keep following the upcoming developments.

M.

···

On Wednesday, August 6, 2014 9:13:08 PM UTC+2, Bryan Van de ven wrote:

Hi Maheuh,

This information really is only guaranteed to be preset in the javascript. In principal this information could be communicated back using the bokeh-server, or it might also be possible to plumb something together in the ipython notebook. Neither of these is currently implemented, however, some work to improve and refactor tools and events is planned which will probably make these ideas more feasible.

Thanks,

Bryan

On Aug 6, 2014, at 5:30 PM, [email protected] wrote:

Hi !

Is there any way of obtaining the limits of the visible area of the plot, just like matplotlib’s xlim() and ylim() methods?

The use case would be to make a figure, let the user play with it (e.g. zoom, pan), and then let him identify a region of interest that would be saved for later (e.g. via a buttom).

It is obviously used already, e.g. in the Previous/Save tool, but it is not clear to me whether all this exists on the Java side only or whether this can be easily accessible from python?

Take this simple code, even without moving/zooming:

import numpy as np

import bokeh.plotting as bplt

x = np.random.randn(100)

y = np.random.randn(100)

bplt.output_server(‘test_interactivity’)
fig = bplt.figure(plot_width=600, plot_height=600, tools=‘pan,wheel_zoom’)

plot = bplt.scatter(x=x, y=y)

bplt.show()

I could not figure out how to determine the range of the plot as shown to the user.

plot.x_range’s start and end property are None (only the padding is defined)

bplt.xaxis()[0].bounds is ‘auto’

Many thanks for you help!

M.


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/c7d486a6-9f6d-43d2-867a-f878f60774b0%40continuum.io.

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