linking plots - large data set

Hi all,

I am having an issue to make pan and zooming actions work across two plots with large data set, here is a code example

···

#********************************************************

from bokeh.plotting import figure, curdoc

from bokeh.layouts import column

from datetime import timedelta, datetime

start_date = “2017-01-01”

start = datetime.strptime(start_date, “%Y-%m-%d”)

x1=

x2=

y1=

y2=

nextpoint = start

for i in range(1,300000):

nextpoint=nextpoint + timedelta(seconds=60)

x1.append(nextpoint)

y1.append(0.5*i)

nextpoint = start

for i in range(0,600000):

nextpoint=nextpoint + timedelta(seconds=30)

x2.append(nextpoint)

y2.append(-0.1*i)

p1 = figure(plot_width=400, plot_height=400, x_axis_type=“datetime”, output_backend=“webgl”)

p1.circle(x1, y1, legend=“y1”, fill_color=“green”, line_alpha = 0, size=5)

p2 = figure(plot_width=400, plot_height=400, x_range=p1.x_range, x_axis_type=“datetime”, output_backend=“webgl”)

p2.circle(x2, y2,legend=“y2”, fill_color=“red”, line_alpha = 0, size=5)

curdoc().add_root(column(p1, p2))

***************************************************************************************

Can you please let me know what I am doing wrong here?

Thanks,

Alex.

Hi, try to add in figure parameter tools

p1 = figure(plot_width=400, plot_height=400, x_axis_type=“datetime”, output_backend=“webgl”, tools=“pan,wheel_zoom,box_zoom”)

Hi,

thanks for you reply, but the problem I am facing with is not about lack of tools on the plots, the following tools are available by default on the plots : ‘pan,wheel_zoom,box_zoom,save,reset,help,

the issue is that neither panning nor zooming are working for those two plots.

Regards,

Alex.

···

On Sunday, February 25, 2018 at 3:25:01 PM UTC, Art Dev wrote:

Hi, try to add in figure parameter tools

p1 = figure(plot_width=400, plot_height=400, x_axis_type=“datetime”, output_backend=“webgl”, tools=“pan,wheel_zoom,box_zoom”)

This is a speculation but I think that having

  x_axis_type="datetime"

In the second plat may result in new range being created for that plot, even though you are trying to share them by setting x_range=p1.x_range as well. Basically I think doing these two things is incompatible. If that fixes the problem for you, then we should make an issue to attempt to detect this situation and issue an error or warning.

Thanks,

Bryan

···

On Feb 25, 2018, at 11:41, [email protected] wrote:

Hi,

thanks for you reply, but the problem I am facing with is not about lack of tools on the plots, the following tools are available by default on the plots : ‘pan,wheel_zoom,box_zoom,save,reset,help,

the issue is that neither panning nor zooming are working for those two plots.

Regards,
Alex.

On Sunday, February 25, 2018 at 3:25:01 PM UTC, Art Dev wrote:
Hi, try to add in figure parameter tools

p1 = figure(plot_width=400, plot_height=400, x_axis_type="datetime", output_backend="webgl", tools="pan,wheel_zoom,box_zoom")

--
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/9aaf3202-1fe2-4cd3-a266-0913ba78f8b9%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Also I note you are using webgl, so that is another possible problem. The previous webgl maintainer is not longer working on the project, and unfortunately several regressions/issues have crept in in their absence. If that is the case you might consider using Datashader together with Bokeh to render the large dataset.

Thanks,

Bryan

···

On Feb 25, 2018, at 06:18, [email protected] wrote:

Hi all,

I am having an issue to make pan and zooming actions work across two plots with large data set, here is a code example

#********************************************************

from bokeh.plotting import figure, curdoc
from bokeh.layouts import column
from datetime import timedelta, datetime

start_date = "2017-01-01"

start = datetime.strptime(start_date, "%Y-%m-%d")

x1=
x2=

y1=
y2=

nextpoint = start
for i in range(1,300000):
    nextpoint=nextpoint + timedelta(seconds=60)
    x1.append(nextpoint)
    y1.append(0.5*i)

nextpoint = start
for i in range(0,600000):
    nextpoint=nextpoint + timedelta(seconds=30)
    x2.append(nextpoint)
    y2.append(-0.1*i)
    
p1 = figure(plot_width=400, plot_height=400, x_axis_type="datetime", output_backend="webgl")
p1.circle(x1, y1, legend="y1", fill_color="green", line_alpha = 0, size=5)
   
p2 = figure(plot_width=400, plot_height=400, x_range=p1.x_range, x_axis_type="datetime", output_backend="webgl")
p2.circle(x2, y2,legend="y2", fill_color="red", line_alpha = 0, size=5)

curdoc().add_root(column(p1, p2))

# ***************************************************************************************

Can you please let me know what I am doing wrong here?

Thanks,
Alex.

--
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/86bd0d75-2af5-45f0-aeab-9c5ec13224a5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I can confirm that with webgl turned off (and a smaller number of points) the

  x_axis_type="datetime"

is ignored, and the range is linked as desired. So I think this is a webgl issue. Unfortunately none of the current core devs have much/any webgl experience I so can't speculate how long it will take for the current issues to be resolved.

For this data size I'd probably just recommend looking at Datashader+Bokeh in any case.

Thanks,

Bryan

···

On Feb 26, 2018, at 11:48, Bryan Van de ven <[email protected]> wrote:

This is a speculation but I think that having

  x_axis_type="datetime"

In the second plat may result in new range being created for that plot, even though you are trying to share them by setting x_range=p1.x_range as well. Basically I think doing these two things is incompatible. If that fixes the problem for you, then we should make an issue to attempt to detect this situation and issue an error or warning.

Thanks,

Bryan

On Feb 25, 2018, at 11:41, [email protected] wrote:

Hi,

thanks for you reply, but the problem I am facing with is not about lack of tools on the plots, the following tools are available by default on the plots : ‘pan,wheel_zoom,box_zoom,save,reset,help,

the issue is that neither panning nor zooming are working for those two plots.

Regards,
Alex.

On Sunday, February 25, 2018 at 3:25:01 PM UTC, Art Dev wrote:
Hi, try to add in figure parameter tools

p1 = figure(plot_width=400, plot_height=400, x_axis_type="datetime", output_backend="webgl", tools="pan,wheel_zoom,box_zoom")

--
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/9aaf3202-1fe2-4cd3-a266-0913ba78f8b9%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.