0

Trying HoloViews for the first time I run into a problem when plotting. I tested a boxplot which appears but cannot be closed. I wished the plot would appear in a browser tab...

Why does the plot appear on top of the browser and how can it be closed?

Here is what I did:

import holoviews as hv
#from holoviews import dim
hv.extension('bokeh')

from bokeh.sampledata.autompg import autompg as df

title = "MPG by Cylinders and Data Source, Colored by Cylinders"
boxwhisker = hv.BoxWhisker(df, ['cyl', 'origin'], 'mpg', label=title)

boxwhisker.options(show_legend=False, width=600)

enter image description here

Tested on:

jupyterlab 0.33.12

python 2.7.15

Firefox Quantum 63.0.3 (64-bit)

mati
  • 1,093
  • 4
  • 12
  • 18

2 Answers2

2

In order for HoloViews plots to be rendered correctly the JupyterLab extension needs to be installed with:

jupyter labextension install @pyviz/jupyterlab_pyviz

Otherwise it will try to attach the plot to the page's body and you end up with the plot hovering. Once you've installed the extension the plot should appear in the correct place.

philippjfr
  • 3,997
  • 14
  • 15
0

I did as philippjfr suggested but installation of the labextension got stuck repeatedly. Here is what it looks like:

(base) C:\Users\xxx>jupyter labextension install @pyviz/jupyterlab_pyviz
> "C:\Program Files\nodejs\npm.CMD" pack @pyviz/jupyterlab_pyviz
pyviz-jupyterlab_pyviz-0.6.3.tgz
Incompatible extension:

"@pyviz/jupyterlab_pyviz@0.6.3" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab              Extension        Package
>=0.17.2 <0.18.0        >=0.19.1 <0.20.0 @jupyterlab/application
>=0.17.2 <0.18.0        >=0.19.1 <0.20.0 @jupyterlab/notebook
>=0.17.2 <0.18.0        >=0.19.1 <0.20.0 @jupyterlab/apputils

Found compatible version: 0.6.0
> "C:\Program Files\nodejs\npm.CMD" pack @pyviz/jupyterlab_pyviz@0.6.0
pyviz-jupyterlab_pyviz-0.6.0.tgz
> node C:\Users\xxx\AppData\Local\Continuum\anaconda2\lib\site-packages\jupyterlab\staging\yarn.js install
yarn install v1.6.0
(node:7700) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info No lockfile found.
[1/4] Resolving packages...
⠁ @pyviz/jupyterlab_pyviz@file:../extensions/pyviz-jupyterlab_pyviz-0.6.0.tgz
mati
  • 1,093
  • 4
  • 12
  • 18
  • I can only suggest trying to update nodejs or JupyterLab and trying again, I can't reproduce that issue locally. – philippjfr Nov 30 '18 at 15:58