Javascript Error - gridplot

I’m trying to plot two plots, one above the other using gridplot.
I have a function that plots several line plots and returns the curplot and I call this twice to pass the two plots to gridplot

This results in the output below:

Javascript error adding output!

TypeError: Cannot read property ‘buttonText’ of undefined

See your browser Javascript console for more details.

Should this work or am I doing something wrong? I’m on bokeh 0.6.1.dev.20140923.

Below is an example of what I’m trying to do which fails for me:


import numpy as np

from numpy.random import randn

import pandas as pd

import bokeh.plotting as plt

from bokeh.objects import DatetimeTickFormatter, DatetimeAxis, HoverTool, ColumnDataSource

plt.output_notebook(force=True)

def plot_gbm(title):

    plt.figure(

        title=title,

        title_text_font_size="20pt",

        plot_width=900,

        plot_height=700,

        x_axis_type="datetime",

    )

    dates = pd.date_range('01-Jan-2015', '01-Jan-2016', freq='D')[:-1]

    plt.hold()

    tools="pan,box_zoom,wheel_zoom,reset,hover"

    plt.line(

        dates, randn(dates.size).cumsum(),

        color='blue',

        legend='Series 1',

        tools=tools,

    )

    plt.line(

        dates, randn(dates.size).cumsum(),

        color='red',

        legend='Series 2',

        tools=tools,

    )

    formats = {

        'months': ["%b-%y"],

        'days': ["%d-%b"],

    }

    plt.xaxis()[0].formatter = DatetimeTickFormatter(formats=formats)

    return plt.curplot()

plt.gridplot([[plot_gbm('Plot A')],[plot_gbm('Plot B')]])

plt.show()

Thanks,

Dave

Still doesn’t work for me with bokeh 0.6.2.dev.20141022.

On a positive not the wheel scrolling now seems to work, however you don’t need to hold down shift to use the wheel zoom contrary to what the help says. I think it works fine without holding down the shift.

Also, both panning & zooming seem to be very fast and smooth with Chrome 38.0.2125.104 m

Thanks,

Dave

···

On Monday, 20 October 2014 17:41:36 UTC+1, [email protected] wrote:

I’m trying to plot two plots, one above the other using gridplot.
I have a function that plots several line plots and returns the curplot and I call this twice to pass the two plots to gridplot

This results in the output below:

Javascript error adding output!

TypeError: Cannot read property ‘buttonText’ of undefined

See your browser Javascript console for more details.

Should this work or am I doing something wrong? I’m on bokeh 0.6.1.dev.20140923.

Hi Dave,

Yes the tools have seen a very big upgrade and improvement, some of the docs have yet to catch up. Will make sure to look into the grid plot in the notebook before the 0.7 release.

Bryan

···

On Oct 23, 2014, at 11:11 AM, [email protected] wrote:

On Monday, 20 October 2014 17:41:36 UTC+1, [email protected] wrote:
I'm trying to plot two plots, one above the other using `gridplot`.
I have a function that plots several line plots and returns the `curplot` and I call this twice to pass the two plots to `gridplot`

This results in the output below:

Javascript error adding output!
TypeError: Cannot read property 'buttonText' of undefined
See your browser Javascript console for more details.

Should this work or am I doing something wrong? I'm on bokeh 0.6.1.dev.20140923.

Still doesn't work for me with bokeh 0.6.2.dev.20141022.

On a positive not the wheel scrolling now seems to work, however you don't need to hold down shift to use the wheel zoom contrary to what the help says. I think it works fine without holding down the shift.

Also, both panning & zooming seem to be very fast and smooth with Chrome 38.0.2125.104 m

Thanks,
Dave

--
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/ca0e454a-193f-4251-95db-d8351a35dc40%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Yep, I’m running in the notebook, a recent version of master:

In [27]: from IPython import sys_info

In [28]: print sys_info()

{‘commit_hash’: u’daa756f’,

‘commit_source’: ‘installation’,

‘default_encoding’: ‘cp1252’,

‘ipython_path’: ‘C:\dev\bin\Anaconda\lib\site-packages\IPython’,

‘ipython_version’: ‘3.0.0-dev’,

‘os_name’: ‘nt’,

‘platform’: ‘Windows-7-6.1.7601-SP1’,

‘sys_executable’: ‘C:\dev\bin\Anaconda\python.exe’,

‘sys_platform’: ‘win32’,

‘sys_version’: ‘2.7.5 |Continuum Analytics, Inc.| (default, Jul 1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)]’}

When I run that grid.py file I see the 4 graphs but they also all pan and zoom independently.

NB: Despite specifying tools="pan,wheel_zoom,box_zoom,reset,previewsave" only pan, box_zoom and wheel_zoom are available on the gridplot. I’d suggest including reset in any set of default tools as its a very important one to have IMHO.

Thanks,

Dave

···

On Thursday, 23 October 2014 18:47:48 UTC+1, Bryan Van de ven wrote:

Hi Dave,

Yes the tools have seen a very big upgrade and improvement, some of the docs have yet to catch up. Will make sure to look into the grid plot in the notebook before the 0.7 release.

Bryan

On Oct 23, 2014, at 5:14 PM, Dave Hirschfeld wrote:

Poking around a bit more I found that it was specifying tools for the plots which caused gridplot to barf. It worked without that.

…however the goal was to have linked brushing but it appears that its currently broken in this version. The linked brushing demo notebook doesn’t work where “doesn’t work” means the plots show but the axes pan and zoom independently.

Can provide more details if you can’t repro the problem…

Cheers,

Dave

From: Bryan Van de Ven <>

Date: Fri, Oct 24, 2014 at 12:30 AM

Subject: Re: [bokeh] Javascript Error - gridplot

To: Dave Hirschfeld <>

HI Dave,

Just to clarify, this is in the notebook? When I run plotting/file/grid.py the tools seem fine but I can believe there might be problems in the notebook. Can you verify that the non-notebook examples work as expected for you?

Thanks,

Bryan

I can confirm this problem in the notebook. Can you make a GH issue? This looks like a problem with the current grid plot related to the tool/event upgrades.

Bryan

···

On Oct 24, 2014, at 2:40 AM, [email protected] wrote:

On Thursday, 23 October 2014 18:47:48 UTC+1, Bryan Van de ven wrote:
Hi Dave,

Yes the tools have seen a very big upgrade and improvement, some of the docs have yet to catch up. Will make sure to look into the grid plot in the notebook before the 0.7 release.

Bryan

>> On Oct 23, 2014, at 5:14 PM, Dave Hirschfeld wrote:
>>
>> Poking around a bit more I found that it was specifying tools for the plots which caused gridplot to barf. It worked without that.
>>
>> ...however the goal was to have linked brushing but it appears that its currently broken in this version. The linked brushing demo notebook doesn't work where "doesn't work" means the plots show but the axes pan and zoom independently.
>>
>> Can provide more details if you can't repro the problem...
>>
>> Cheers,
>> Dave
>>
> From: Bryan Van de Ven <>
> Date: Fri, Oct 24, 2014 at 12:30 AM
> Subject: Re: [bokeh] Javascript Error - gridplot
> To: Dave Hirschfeld <>
>
>
> HI Dave,
>
> Just to clarify, this is in the notebook? When I run plotting/file/grid.py the tools seem fine but I can believe there might be problems in the notebook. Can you verify that the non-notebook examples work as expected for you?
>
> Thanks,
>
> Bryan

Yep, I'm running in the notebook, a recent version of master:

In [27]: from IPython import sys_info

In [28]: print sys_info()
{'commit_hash': u'daa756f',
'commit_source': 'installation',
'default_encoding': 'cp1252',
'ipython_path': 'C:\\dev\\bin\\Anaconda\\lib\\site-packages\\IPython',
'ipython_version': '3.0.0-dev',
'os_name': 'nt',
'platform': 'Windows-7-6.1.7601-SP1',
'sys_executable': 'C:\\dev\\bin\\Anaconda\\python.exe',
'sys_platform': 'win32',
'sys_version': '2.7.5 |Continuum Analytics, Inc.| (default, Jul 1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)]'}

When I run that grid.py file I see the 4 graphs but they also all pan and zoom independently.

NB: Despite specifying `tools="pan,wheel_zoom,box_zoom,reset,previewsave"` only pan, box_zoom and wheel_zoom are available on the gridplot. I'd suggest including reset in *any* set of default tools as its a very important one to have IMHO.

Thanks,
Dave

--
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/7e20c741-b128-4418-97be-ba0db59be7e8%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Since I think there are two separate problems here I’ve submitted two issues:

linked brushing broken in notebook

https://github.com/bokeh/bokeh/issues/1342

gridplot causes javascript error in notebook

https://github.com/bokeh/bokeh/issues/1343

Thanks,

Dave

···

On Sunday, 26 October 2014 15:04:03 UTC, Bryan Van de ven wrote:

I can confirm this problem in the notebook. Can you make a GH issue? This looks like a problem with the current grid plot related to the tool/event upgrades.

Bryan