Bokeh plots don't show up using nbconvert on Terminal

Hi,

I generate NB cells programmatically and then execute them using “jupyter nbconvert” but unlike matplotlib plots, Bokeh plots don’t appear.

Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb

Run following:

jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb

In “color_scatterplot_run.ipynb”, it seems the cells are executed but the plot doesn’t show up. It does after manually running the corresponding cell.

Thanks

Gungor

Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

* view them locally, or

* on a site the preserves JS code intact, such as nbviewer.org or anaconda.org

  Jupyter Notebook Viewer

  Notebook :: Anaconda.org

Thanks,

Bryan

···

On Aug 7, 2017, at 09:04, [email protected] wrote:

Hi,

I generate NB cells programmatically and then execute them using "jupyter nbconvert" but unlike matplotlib plots, Bokeh plots don't appear.

Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb

Run following:

jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb

In "color_scatterplot_run.ipynb", it seems the cells are executed but the plot doesn't show up. It does after manually running the corresponding cell.

Thanks
Gungor

--
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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

I understand but it seems there is an embedding feature which puts plots inside an HTML and the plots will be rendered inside them. Isn’t this an option for notebooks? I’m not going to host notebooks on GitHub but I need them pre-rendered. I saw there is also an option to include JS inside IPYNB file but still the plots are not there unless I open the notebook on the browser and run the cell manually.

Best,

Gungor

···

On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de ven wrote:

Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

  • view them locally, or

  • on a site the preserves JS code intact, such as nbviewer.org or anaconda.org

      [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)
    
    
    
      [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)
    

Thanks,

Bryan

On Aug 7, 2017, at 09:04, [email protected] wrote:

Hi,

I generate NB cells programmatically and then execute them using “jupyter nbconvert” but unlike matplotlib plots, Bokeh plots don’t appear.

Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb

Run following:

jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb

In “color_scatterplot_run.ipynb”, it seems the cells are executed but the plot doesn’t show up. It does after manually running the corresponding cell.

Thanks

Gungor


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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io.

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

Hi,

Sorry, I just saw GH in the URL and made an assumption, since that is the usual issue. I didn't notice you mentioned downloading the notebook. I'm not sure offhand, since I don't really use nbconvert. For this I'd suggest a GH issue with detailed version information, then we can try to ping one of the nbconvert devs for more assistance.

Thanks,

Bryan

···

On Aug 7, 2017, at 09:33, Güngör Budak <[email protected]> wrote:

Hi Bryan,

I understand but it seems there is an embedding feature which puts plots inside an HTML and the plots will be rendered inside them. Isn't this an option for notebooks? I'm not going to host notebooks on GitHub but I need them pre-rendered. I saw there is also an option to include JS inside IPYNB file but still the plots are not there unless I open the notebook on the browser and run the cell manually.

Best,
Gungor

On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de ven wrote:
Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

* view them locally, or

* on a site the preserves JS code intact, such as nbviewer.org or anaconda.org

        Jupyter Notebook Viewer

        Notebook :: Anaconda.org

Thanks,

Bryan

> On Aug 7, 2017, at 09:04, gng...@gmail.com wrote:
>
> Hi,
>
> I generate NB cells programmatically and then execute them using "jupyter nbconvert" but unlike matplotlib plots, Bokeh plots don't appear.
>
> Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb
>
> Run following:
>
> jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb
>
> In "color_scatterplot_run.ipynb", it seems the cells are executed but the plot doesn't show up. It does after manually running the corresponding cell.
>
> Thanks
> Gungor
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice

first, however for the notebook rendering on anaconda.org (which I
have been involved with developing), I am fairly sure we are simply
using jupyter nbconvert from the command line to create that
content. And as you can see from anaconda.org examples the Bokeh
plots display properly and are interactive, e.g.

(see Bokeh plot at the end of the notebook)

Are you able to share an example of the notebooks you have that do
not convert/display properly?
Thanks,
Ian

···

https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

      I understand but it seems there is an embedding feature

which puts plots inside an HTML and the plots will be rendered
inside them. Isn’t this an option for notebooks? I’m not going
to host notebooks on GitHub but I need them pre-rendered. I
saw there is also an option to include JS inside IPYNB file
but still the plots are not there unless I open the notebook
on the browser and run the cell manually.

Best,

Gungor

      On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de

ven wrote:

Hi,

        Bokeh plots are actually rendered by a companion JavaScrip

library, BokehJS. However, GitHub strips all JavaScript from
pages and notebooks that it renders. Bokeh will will never
be able to display in notebooks rendered on GitHub as long
as this is true (and we have no control whatsoever over
this). To see Bokeh plots in rendered notebooks, you will
have to

        * view them locally, or



        * on a site the preserves JS code intact, such as [nbviewer.org](http://nbviewer.org) or [anaconda.org](http://anaconda.org)




                [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)




                [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)




        Thanks,




        Bryan



        > On Aug 7, 2017, at 09:04, [email protected] wrote:


        >

        > Hi,


        >

        > I generate NB cells programmatically and then execute

them using “jupyter nbconvert” but unlike matplotlib plots,
Bokeh plots don’t appear.

        >

        > Try downloading this example from main repo: [https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb](https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb)


        >

        > Run following:


        >

        > jupyter nbconvert --to notebook --execute

color_scatterplot.ipynb --output color_scatterplot_run.ipynb

        >

        > In "color_scatterplot_run.ipynb", it seems the cells

are executed but the plot doesn’t show up. It does after
manually running the corresponding cell.

        >

        > Thanks


        > Gungor


        >

        > --

        > 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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io)            .


        > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout)            .

  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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io?utm_medium=email&utm_source=footer).

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


Ian Stokes-Rees, PhD
Computational Scientist
`
1.617.942.0218

      [email protected]

      [@ContinuumIO](http://twitter.com/ContinuumIO)
      [@ijstokes](http://twitter.com/ijstokes)
    `



Gungnor,

Also to clarify, you are trying to generate statically rendered (HTML) notebook output? Or you are trying to execute notebooks programmatically? The former is fairly well-known ground I think, with "jupiter nbconvert" as Ian mentions. I am not aware of anyone using nbconvrt for programmatic notebook evaluation, though, so I could easily believe there are issues there, if you are the first person to try it.

Thanks,

Bryan

···

On Aug 7, 2017, at 09:42, Ian Stokes Rees <[email protected]> wrote:

Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice first, however for the notebook rendering on anaconda.org (which I have been involved with developing), I am fairly sure we are simply using `jupyter nbconvert` from the command line to create that content. And as you can see from anaconda.org examples the Bokeh plots display properly and are interactive, e.g.

Notebook :: Anaconda.org

(see Bokeh plot at the end of the notebook)

Are you able to share an example of the notebooks you have that do not convert/display properly?

Thanks,

Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

I understand but it seems there is an embedding feature which puts plots inside an HTML and the plots will be rendered inside them. Isn't this an option for notebooks? I'm not going to host notebooks on GitHub but I need them pre-rendered. I saw there is also an option to include JS inside IPYNB file but still the plots are not there unless I open the notebook on the browser and run the cell manually.

Best,
Gungor

On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de ven wrote:
Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

* view them locally, or

* on a site the preserves JS code intact, such as nbviewer.org or anaconda.org

        Jupyter Notebook Viewer

        Notebook :: Anaconda.org

Thanks,

Bryan

> On Aug 7, 2017, at 09:04, gng...@gmail.com wrote:
>
> Hi,
>
> I generate NB cells programmatically and then execute them using "jupyter nbconvert" but unlike matplotlib plots, Bokeh plots don't appear.
>
> Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb
>
> Run following:
>
> jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb
>
> In "color_scatterplot_run.ipynb", it seems the cells are executed but the plot doesn't show up. It does after manually running the corresponding cell.
>
> Thanks
> Gungor
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
Ian Stokes-Rees, PhD
Computational Scientist
1.617.942.0218
[email protected]
@ContinuumIO @ijstokes

--
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/a61927bb-10e2-1720-d0fd-287a2a2acc86%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Ian,

Thanks a lot for the example, they are indeed visible on anaconda.org I wonder how they are hosted as HTML or in another format?

What I expect is to have actual interactive plot within *.ipynb file that is executed.

To test, download the attached “color_scatterplot.ipynb”

Run this: jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_output.ipynb

And check if you get the same output as attached one named “color_scatterplot_output.ipynb”.

In this output, I have numbers in the brackets left to the cells which show they were executed but I cannot see the actual plot.

You can view these locally or online.

Best,

Gungor

color_scatterplot_output.ipynb (199 KB)

color_scatterplot.ipynb (2.5 KB)

···

On Monday, August 7, 2017 at 5:42:41 PM UTC+3, Ian Stokes-Rees wrote:

Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice

first, however for the notebook rendering on anaconda.org (which I
have been involved with developing), I am fairly sure we are simply
using jupyter nbconvert from the command line to create that
content. And as you can see from anaconda.org examples the Bokeh
plots display properly and are interactive, e.g.

https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook

(see Bokeh plot at the end of the notebook)



Are you able to share an example of the notebooks you have that do

not convert/display properly?

Thanks,



Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

      I understand but it seems there is an embedding feature

which puts plots inside an HTML and the plots will be rendered
inside them. Isn’t this an option for notebooks? I’m not going
to host notebooks on GitHub but I need them pre-rendered. I
saw there is also an option to include JS inside IPYNB file
but still the plots are not there unless I open the notebook
on the browser and run the cell manually.

Best,

Gungor

      On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de > > ven wrote:

Hi,

        Bokeh plots are actually rendered by a companion JavaScrip

library, BokehJS. However, GitHub strips all JavaScript from
pages and notebooks that it renders. Bokeh will will never
be able to display in notebooks rendered on GitHub as long
as this is true (and we have no control whatsoever over
this). To see Bokeh plots in rendered notebooks, you will
have to

        * view them locally, or



        * on a site the preserves JS code intact, such as [nbviewer.org](http://nbviewer.org) or [anaconda.org](http://anaconda.org)




                [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)




                [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)




        Thanks,




        Bryan



        > On Aug 7, 2017, at 09:04, [email protected] wrote:


        >

        > Hi,


        >

        > I generate NB cells programmatically and then execute

them using “jupyter nbconvert” but unlike matplotlib plots,
Bokeh plots don’t appear.

        >

        > Try downloading this example from main repo: [https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb](https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb)


        >

        > Run following:


        >

        > jupyter nbconvert --to notebook --execute

color_scatterplot.ipynb --output color_scatterplot_run.ipynb

        >

        > In "color_scatterplot_run.ipynb", it seems the cells

are executed but the plot doesn’t show up. It does after
manually running the corresponding cell.

        >

        > Thanks


        > Gungor


        >

        > --

        > 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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io)            .


        > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout)            .

  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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io?utm_medium=email&utm_source=footer).

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


Ian Stokes-Rees, PhD
Computational Scientist
`
1.617.942.0218

      [email protected]

      [@ContinuumIO](http://twitter.com/ContinuumIO)
      [@ijstokes](http://twitter.com/ijstokes)
    `



Bryan,

I will also need HTML version of these plots. I’m again using “jupyter nbconvert” for converting executed and rendered *.ipynb file to HTML file. I do both, first execute them and then convert them to HTML for viewing them as a notebook and as an HTML snapshot of the notebook

Best

Gungor

···

On Monday, August 7, 2017 at 5:48:48 PM UTC+3, Bryan Van de ven wrote:

Gungnor,

Also to clarify, you are trying to generate statically rendered (HTML) notebook output? Or you are trying to execute notebooks programmatically? The former is fairly well-known ground I think, with “jupiter nbconvert” as Ian mentions. I am not aware of anyone using nbconvrt for programmatic notebook evaluation, though, so I could easily believe there are issues there, if you are the first person to try it.

Thanks,

Bryan

On Aug 7, 2017, at 09:42, Ian Stokes Rees [email protected] wrote:

Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice first, however for the notebook rendering on anaconda.org (which I have been involved with developing), I am fairly sure we are simply using jupyter nbconvert from the command line to create that content. And as you can see from anaconda.org examples the Bokeh plots display properly and are interactive, e.g.

https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook

(see Bokeh plot at the end of the notebook)

Are you able to share an example of the notebooks you have that do not convert/display properly?

Thanks,

Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

I understand but it seems there is an embedding feature which puts plots inside an HTML and the plots will be rendered inside them. Isn’t this an option for notebooks? I’m not going to host notebooks on GitHub but I need them pre-rendered. I saw there is also an option to include JS inside IPYNB file but still the plots are not there unless I open the notebook on the browser and run the cell manually.

Best,

Gungor

On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de ven wrote:

Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

    [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)
    [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)

Thanks,

Bryan

On Aug 7, 2017, at 09:04, [email protected] wrote:

Hi,

I generate NB cells programmatically and then execute them using “jupyter nbconvert” but unlike matplotlib plots, Bokeh plots don’t appear.

Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb

Run following:

jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb

In “color_scatterplot_run.ipynb”, it seems the cells are executed but the plot doesn’t show up. It does after manually running the corresponding cell.

Thanks
Gungor


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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io.

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

Ian Stokes-Rees, PhD

Computational Scientist

1.617.942.0218

[email protected]

@ContinuumIO @ijstokes


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/a61927bb-10e2-1720-d0fd-287a2a2acc86%40continuum.io.

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

Hi Ian,

I downloaded the notebook file from anaconda.org page that you sent and ran locally myself and saw that it doesn’t show the scatter plot. Attached is the scrreenshot. Can you check out?

Best

Gungor

···

On Monday, August 7, 2017 at 5:42:41 PM UTC+3, Ian Stokes-Rees wrote:

Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice

first, however for the notebook rendering on anaconda.org (which I
have been involved with developing), I am fairly sure we are simply
using jupyter nbconvert from the command line to create that
content. And as you can see from anaconda.org examples the Bokeh
plots display properly and are interactive, e.g.

https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook

(see Bokeh plot at the end of the notebook)



Are you able to share an example of the notebooks you have that do

not convert/display properly?

Thanks,



Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

      I understand but it seems there is an embedding feature

which puts plots inside an HTML and the plots will be rendered
inside them. Isn’t this an option for notebooks? I’m not going
to host notebooks on GitHub but I need them pre-rendered. I
saw there is also an option to include JS inside IPYNB file
but still the plots are not there unless I open the notebook
on the browser and run the cell manually.

Best,

Gungor

      On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de > > ven wrote:

Hi,

        Bokeh plots are actually rendered by a companion JavaScrip

library, BokehJS. However, GitHub strips all JavaScript from
pages and notebooks that it renders. Bokeh will will never
be able to display in notebooks rendered on GitHub as long
as this is true (and we have no control whatsoever over
this). To see Bokeh plots in rendered notebooks, you will
have to

        * view them locally, or



        * on a site the preserves JS code intact, such as [nbviewer.org](http://nbviewer.org) or [anaconda.org](http://anaconda.org)




                [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)




                [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)




        Thanks,




        Bryan



        > On Aug 7, 2017, at 09:04, [email protected] wrote:


        >

        > Hi,


        >

        > I generate NB cells programmatically and then execute

them using “jupyter nbconvert” but unlike matplotlib plots,
Bokeh plots don’t appear.

        >

        > Try downloading this example from main repo: [https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb](https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb)


        >

        > Run following:


        >

        > jupyter nbconvert --to notebook --execute

color_scatterplot.ipynb --output color_scatterplot_run.ipynb

        >

        > In "color_scatterplot_run.ipynb", it seems the cells

are executed but the plot doesn’t show up. It does after
manually running the corresponding cell.

        >

        > Thanks


        > Gungor


        >

        > --

        > 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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io)            .


        > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout)            .

  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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io?utm_medium=email&utm_source=footer).

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


Ian Stokes-Rees, PhD
Computational Scientist
`
1.617.942.0218

      [email protected]

      [@ContinuumIO](http://twitter.com/ContinuumIO)
      [@ijstokes](http://twitter.com/ijstokes)
    `



Hello Gungor,

I can confirm that using the --execute mechanism with the notebook

does not cause the JavaScript portions that generate the interactive
Bokeh plot to appear in the CLI-generated output.

I am not an expert in these things but if I had to guess I'd say

that this is because jupyter nbconvert --execute is only going to
do the server-side portion of executing the notebook. The rendered
Bokeh plot is created by the client-side (i.e. “in browser”)
JavaScript and then (I think, but this is just a guess) that newly
generated JavaScript + JSON + HTML is only “saved” on the
server-side when the browser client UI selects “Save”.

For you to get the same behavior with `jupyter nbconver --execute`

it would be necessary to have a headless browser run the notebook.
I suspect the Jupyter team are already aware of this issue, but a
quick Google search doesn’t turn anything up. If you submit an
issue I think this is the place to do it:

Or the Jupyter mailing list:

Again, I can’t be sure that my analysis is correct, but that is my
best guess as to what is going on.
Good luck and let us know if you figure out the source of the
problem and any solution/work-around.
Ian

···

https://github.com/jupyter/nbconvert/issues

https://groups.google.com/forum/#!forum/jupyter

On 8/7/17 12:08 PM, Güngör Budak wrote:

Hi Ian,

      Thanks a lot for the example, they are indeed visible on

anaconda.org I wonder how they are hosted as HTML or in
another format?

      What I expect is to have actual interactive plot within

*.ipynb file that is executed.

To test, download the attached “color_scatterplot.ipynb”

      Run this: jupyter nbconvert --to notebook --execute

color_scatterplot.ipynb --output
color_scatterplot_output.ipynb

      And check if you get the same output as attached one named

“color_scatterplot_output.ipynb”.

      In this output, I have numbers in the brackets left to the

cells which show they were executed but I cannot see the
actual plot.

You can view these locally or online.

Best,

Gungor

      On Monday, August 7, 2017 at 5:42:41 PM UTC+3, Ian Stokes-Rees

wrote:

Hello Gungor,

          Bryan is more expert on Bokeh, so you should go with his

advice first, however for the notebook rendering on anaconda.org (which I
have been involved with developing), I am fairly sure we
are simply using jupyter nbconvert from the command line
to create that content. And as you can see from anaconda.org examples
the Bokeh plots display properly and are interactive, e.g.

          [https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook](https://anaconda.org/ijstokes/1-open-data-science-for-everyone/notebook)



          (see Bokeh plot at the end of the notebook)



          Are you able to share an example of the notebooks you have

that do not convert/display properly?

          Thanks,



          Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

                I understand but it seems there is an embedding

feature which puts plots inside an HTML and the
plots will be rendered inside them. Isn’t this an
option for notebooks? I’m not going to host
notebooks on GitHub but I need them pre-rendered. I
saw there is also an option to include JS inside
IPYNB file but still the plots are not there unless
I open the notebook on the browser and run the cell
manually.

Best,

Gungor

                On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan

Van de ven wrote:

                  Hi,




                  Bokeh plots are actually rendered by a companion

JavaScrip library, BokehJS. However, GitHub strips
all JavaScript from pages and notebooks that it
renders. Bokeh will will never be able to display
in notebooks rendered on GitHub as long as this is
true (and we have no control whatsoever over
this). To see Bokeh plots in rendered notebooks,
you will have to

                  * view them locally, or



                  * on a site the preserves JS code intact, such as

nbviewer.org
or anaconda.org

                          [https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)




                          [https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook](https://anaconda.org/dhirschfeld/bokeh-timeseries-example/notebook)




                  Thanks,



                  Bryan



                  > On Aug 7, 2017, at 09:04, [email protected]
                  wrote:

                  >

                  > Hi,

                  >

                  > I generate NB cells programmatically and then

execute them using “jupyter nbconvert” but unlike
matplotlib plots, Bokeh plots don’t appear.

                  >

                  > Try downloading this example from main repo:

https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb

                  >

                  > Run following:

                  >

                  > jupyter nbconvert --to notebook --execute

color_scatterplot.ipynb --output
color_scatterplot_run.ipynb

                  >

                  > In "color_scatterplot_run.ipynb", it seems

the cells are executed but the plot doesn’t show
up. It does after manually running the
corresponding cell.

                  >

                  > Thanks

                  > Gungor

                  >

                  > --

                  > 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/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io)                      .


                  > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout)                      .

            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/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io?utm_medium=email&utm_source=footer).

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


Ian Stokes-Rees, PhD
Computational Scientist
` 1.617.942.0218

                [email protected]

                [@ContinuumIO](http://twitter.com/ContinuumIO) [@ijstokes](http://twitter.com/ijstokes) `

  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/0db5e5e4-b9cb-4c62-830e-28c83bb589ea%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/0db5e5e4-b9cb-4c62-830e-28c83bb589ea%40continuum.io?utm_medium=email&utm_source=footer).

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


Ian Stokes-Rees, PhD
Computational Scientist
`
1.617.942.0218

      [email protected]

      [@ContinuumIO](http://twitter.com/ContinuumIO)
      [@ijstokes](http://twitter.com/ijstokes)
    `



I don't know enough about nbconvert to speculate much, but if that is indeed how "nbconvert --execute` functions then the analysis seems plausible. I agree that the best place to move forward at this point is an issue on the nbconvert GH issue tracker.

Thanks,

Bryan

···

On Aug 7, 2017, at 10:26, Ian Stokes Rees <[email protected]> wrote:

Hello Gungor,

I can confirm that using the --execute mechanism with the notebook does not cause the JavaScript portions that generate the interactive Bokeh plot to appear in the CLI-generated output.

I am not an expert in these things but if I had to guess I'd say that this is because `jupyter nbconvert --execute` is only going to do the server-side portion of executing the notebook. The rendered Bokeh plot is created by the client-side (i.e. "in browser") JavaScript and then (I think, but this is just a guess) that newly generated JavaScript + JSON + HTML is only "saved" on the server-side when the browser client UI selects "Save".

For you to get the same behavior with `jupyter nbconver --execute` it would be necessary to have a headless browser run the notebook. I suspect the Jupyter team are already aware of this issue, but a quick Google search doesn't turn anything up. If you submit an issue I think this is the place to do it:

Issues · jupyter/nbconvert · GitHub

Or the Jupyter mailing list:

Redirecting to Google Groups

Again, I can't be sure that my analysis is correct, but that is my best guess as to what is going on.

Good luck and let us know if you figure out the source of the problem and any solution/work-around.

Ian

On 8/7/17 12:08 PM, Güngör Budak wrote:

Hi Ian,

Thanks a lot for the example, they are indeed visible on anaconda.org I wonder how they are hosted as HTML or in another format?

What I expect is to have actual interactive plot within *.ipynb file that is executed.

To test, download the attached "color_scatterplot.ipynb"

Run this: jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_output.ipynb

And check if you get the same output as attached one named "color_scatterplot_output.ipynb".

In this output, I have numbers in the brackets left to the cells which show they were executed but I cannot see the actual plot.

You can view these locally or online.

Best,
Gungor

On Monday, August 7, 2017 at 5:42:41 PM UTC+3, Ian Stokes-Rees wrote:
Hello Gungor,

Bryan is more expert on Bokeh, so you should go with his advice first, however for the notebook rendering on anaconda.org (which I have been involved with developing), I am fairly sure we are simply using `jupyter nbconvert` from the command line to create that content. And as you can see from anaconda.org examples the Bokeh plots display properly and are interactive, e.g.

Notebook :: Anaconda.org

(see Bokeh plot at the end of the notebook)

Are you able to share an example of the notebooks you have that do not convert/display properly?

Thanks,

Ian

On 8/7/17 11:33 AM, Güngör Budak wrote:

Hi Bryan,

I understand but it seems there is an embedding feature which puts plots inside an HTML and the plots will be rendered inside them. Isn't this an option for notebooks? I'm not going to host notebooks on GitHub but I need them pre-rendered. I saw there is also an option to include JS inside IPYNB file but still the plots are not there unless I open the notebook on the browser and run the cell manually.

Best,
Gungor

On Monday, August 7, 2017 at 5:22:52 PM UTC+3, Bryan Van de ven wrote:
Hi,

Bokeh plots are actually rendered by a companion JavaScrip library, BokehJS. However, GitHub strips all JavaScript from pages and notebooks that it renders. Bokeh will will never be able to display in notebooks rendered on GitHub as long as this is true (and we have no control whatsoever over this). To see Bokeh plots in rendered notebooks, you will have to

* view them locally, or

* on a site the preserves JS code intact, such as nbviewer.org or anaconda.org

        Jupyter Notebook Viewer

        Notebook :: Anaconda.org

Thanks,

Bryan

> On Aug 7, 2017, at 09:04, gng...@gmail.com wrote:
>
> Hi,
>
> I generate NB cells programmatically and then execute them using "jupyter nbconvert" but unlike matplotlib plots, Bokeh plots don't appear.
>
> Try downloading this example from main repo: https://raw.githubusercontent.com/bokeh/bokeh/master/examples/plotting/notebook/color_scatterplot.ipynb
>
> Run following:
>
> jupyter nbconvert --to notebook --execute color_scatterplot.ipynb --output color_scatterplot_run.ipynb
>
> In "color_scatterplot_run.ipynb", it seems the cells are executed but the plot doesn't show up. It does after manually running the corresponding cell.
>
> Thanks
> Gungor
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a74444ed-0b01-41b6-a2bb-a9fe7420ef57%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2254cebb-e06f-41af-b5ca-e5ff7c99af0f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
Ian Stokes-Rees, PhD
Computational Scientist
1.617.942.0218
ijst...@continuum.io
@ContinuumIO @ijstokes

--
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/0db5e5e4-b9cb-4c62-830e-28c83bb589ea%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
Ian Stokes-Rees, PhD
Computational Scientist
1.617.942.0218
[email protected]
@ContinuumIO @ijstokes

--
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/3a0c4ca9-3d43-9cbd-c91a-692d7d3eea6f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Strange! I can confirm that I do not see the scatter plot when I
download the notebook. I don’t know what mechanism the Anaconda
Cloud server is using, then, to preserve and present the notebook.
Sorry I can’t help more.
Ian

···

On 8/7/17 12:22 PM, Güngör Budak wrote:

Hi Ian,

      I downloaded the notebook file from anaconda.org page that

you sent and ran locally myself and saw that it doesn’t show
the scatter plot. Attached is the scrreenshot. Can you check
out?

Bryan and Ian,

Thanks much, I’ll forward the discussion to Jupyter to see if they can help

Best,

Gungor

···

On Monday, August 7, 2017 at 6:32:08 PM UTC+3, Ian Stokes-Rees wrote:

On 8/7/17 12:22 PM, Güngör Budak wrote:

Hi Ian,

I downloaded the notebook file from anaconda.org page that
you sent and ran locally myself and saw that it doesn’t show
the scatter plot. Attached is the scrreenshot. Can you check
out?

Strange! I can confirm that I do not see the scatter plot when I

download the notebook. I don’t know what mechanism the Anaconda
Cloud server is using, then, to preserve and present the notebook.

Sorry I can't help more.



Ian

Hi,
This is a quite old post, but did anyone succeed to convert a bokeh notebook to html with nbconvert ?

@Olivier_Archer nbconvert properly renders Bokeh content, as can be verified by viewing any of the statically rendered Bokeh notebooks up on nbviewer.jupyter.org, for example:

Jupyter Notebook Viewer

many thanks @Bryan, I was missing:

import bokeh.io
bokeh.io.output_notebook()

In my notebook. Previously, I was only using

import geoviews as gv
gv.extension('bokeh')

that is enough for rendering bokeh plot in a live notebook, but not with nbconvert.

@Olivier_Archer I’ll take your word and I’m glad that works. The geoviews extension is not something we produce or maintain, so I definitely can’t speak to what exactly it does.