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:
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.
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'
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.
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: