[bokeh] 3D Plot - Leveraging Other Libraries

Hi all,

First thanks a lot for you hard work on keeping improving Bokeh, it is a great tool !

I am using Bokeh 0.12.16 and I have recently tried integrating a 3d plot in one of the tabs of a Bokeh Application I am currently developping.

I used the example provided in the Bokeh documentation (link below) using vis.js, and it works perfectly.

https://bokeh.pydata.org/en/latest/docs/user_guide/extensions_gallery/wrapping.html

Unfortunately, vis.js library doesn’t provide a lot of options for customization, especially when related to plotting multiple “objects” with different styles and/or data sources in a same 3Dchart (option that i needed for this 3d plot).

Matplotlib seems much more powerful in that sense (example below).

https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html

Looking for a way of combining Matplotlib and Bokeh plots in the same document, I realised the bokeh.pml.to_bokeh function allowed Bokeh to show figures created using Matplotlib (with Bokeh 0.12.13).

https://bokeh.pydata.org/en/0.12.3/docs/user_guide/compat.html

Since that function isn’t available anymore in Bokeh 0.12.16, do you have any idea on how this could be done or maybe some documentation explaining how to wrap other 3D JavaScript libraries ?

Thanks for your help,

Regards,

Jim

Hi,

The mpl.to_bokeh function was never able to convert 3D plots, so it would not have helped here. In fact, it was barely ever able to do much at all. The long-discussed MPL JSON spec that might have made maintainable MPL compatibility possible never materialized, which is why the whole idea was ultimately abandoned.

In any case, the core Bokeh library does not focus on or provide any built-in 3d capability, and it's unlikely that it ever will. The "surface3d" example is mostly intended as a demonstration that Bokeh can be extended with custom models and external JS libraries, but the underlying vis.js library that it wraps is purely a toy, in my opinion. If anyone wanted to create a custom extension to integrate a better 3d JS library with Bokeh, that would be great. Something like three.js is probably a good candidate, though there may be others I am not aware of. It could be a little work or a lot of work, depending on whether the extension was very specialized and narrow, or more general. For reference, the chapter on creating custom extensions is here:

  https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

···

On Jun 20, 2018, at 07:09, Jim Rhone <[email protected]> wrote:

Hi all,

First thanks a lot for you hard work on keeping improving Bokeh, it is a great tool !

I am using Bokeh 0.12.16 and I have recently tried integrating a 3d plot in one of the tabs of a Bokeh Application I am currently developping.
I used the example provided in the Bokeh documentation (link below) using vis.js, and it works perfectly.
https://bokeh.pydata.org/en/latest/docs/user_guide/extensions_gallery/wrapping.html

Unfortunately, vis.js library doesn't provide a lot of options for customization, especially when related to plotting multiple "objects" with different styles and/or data sources in a same 3Dchart (option that i needed for this 3d plot).
Matplotlib seems much more powerful in that sense (example below).
https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html

Looking for a way of combining Matplotlib and Bokeh plots in the same document, I realised the bokeh.pml.to_bokeh function allowed Bokeh to show figures created using Matplotlib (with Bokeh 0.12.13).
Leveraging Other Libraries — Bokeh 0.12.3 documentation

Since that function isn't available anymore in Bokeh 0.12.16, do you have any idea on how this could be done or maybe some documentation explaining how to wrap other 3D JavaScript libraries ?

Thanks for your help,
Regards,

Jim

--
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/d518ab8b-55c2-4eae-9cff-4d36126d410c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

It would be great to have a sister library offering well-integrated 3D support in Bokeh, but in the meantime, you can use HoloViews to combine Bokeh plots with 3D Matplotlib (or Plotly) plots in a layout, as shown in http://holoviews.org/reference/elements/bokeh/Div.html.

···

On Wed, Jun 20, 2018 at 5:45 PM, Bryan Van de ven [email protected] wrote:

Hi,

The mpl.to_bokeh function was never able to convert 3D plots, so it would not have helped here. In fact, it was barely ever able to do much at all. The long-discussed MPL JSON spec that might have made maintainable MPL compatibility possible never materialized, which is why the whole idea was ultimately abandoned.

In any case, the core Bokeh library does not focus on or provide any built-in 3d capability, and it’s unlikely that it ever will. The “surface3d” example is mostly intended as a demonstration that Bokeh can be extended with custom models and external JS libraries, but the underlying vis.js library that it wraps is purely a toy, in my opinion. If anyone wanted to create a custom extension to integrate a better 3d JS library with Bokeh, that would be great. Something like three.js is probably a good candidate, though there may be others I am not aware of. It could be a little work or a lot of work, depending on whether the extension was very specialized and narrow, or more general. For reference, the chapter on creating custom extensions is here:

    [https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html](https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html)

Thanks,

Bryan

On Jun 20, 2018, at 07:09, Jim Rhone [email protected] wrote:

Hi all,

First thanks a lot for you hard work on keeping improving Bokeh, it is a great tool !

I am using Bokeh 0.12.16 and I have recently tried integrating a 3d plot in one of the tabs of a Bokeh Application I am currently developping.

I used the example provided in the Bokeh documentation (link below) using vis.js, and it works perfectly.

https://bokeh.pydata.org/en/latest/docs/user_guide/extensions_gallery/wrapping.html

Unfortunately, vis.js library doesn’t provide a lot of options for customization, especially when related to plotting multiple “objects” with different styles and/or data sources in a same 3Dchart (option that i needed for this 3d plot).

Matplotlib seems much more powerful in that sense (example below).

https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html

Looking for a way of combining Matplotlib and Bokeh plots in the same document, I realised the bokeh.pml.to_bokeh function allowed Bokeh to show figures created using Matplotlib (with Bokeh 0.12.13).

https://bokeh.pydata.org/en/0.12.3/docs/user_guide/compat.html

Since that function isn’t available anymore in Bokeh 0.12.16, do you have any idea on how this could be done or maybe some documentation explaining how to wrap other 3D JavaScript libraries ?

Thanks for your help,

Regards,

Jim

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/d518ab8b-55c2-4eae-9cff-4d36126d410c%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/0A6ADCD2-1740-4D29-A28A-1A681AB2DBF2%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.