第一次尝试HoloViews时我在绘图时遇到问题。我测试了出现但无法关闭的箱线图。 我希望剧情会出现在浏览器选项卡中...
为什么该图出现在浏览器的顶部,如何将其关闭?
这是我所做的:
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)
经过测试:
jupyterlab 0.33.12
python 2.7.15
Firefox Quantum 63.0.3(64位)
答案 0 :(得分:2)
为了正确显示HoloViews图,需要使用以下命令安装JupyterLab扩展程序:
jupyter labextension install @pyviz/jupyterlab_pyviz
否则,它将尝试将图附着到页面的正文上,并且最终使图悬停。安装扩展程序后,绘图应显示在正确的位置。
答案 1 :(得分:0)
我按照philippjfr的建议进行了操作,但是labextension的安装反复出现卡住。看起来像这样:
(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