【发布时间】:2019-02-14 18:55:34
【问题描述】:
我有一个运行 jupyterlab 的 VM,并已将其打开以供外部访问。当 jupyter-lab 启动时,会打开一个本地浏览器,这很好。
在外部,我访问了 jupyterlab,一切似乎都可以正常工作。但是,当我绘图时,输出不会显示在浏览器中,而是显示为 本地浏览器中的一个新选项卡,该浏览器以 jupyter-lab 启动。
如果我有%matplotlib inline,也会发生同样的事情。
以下内容要好一些,因为现在内容是内联显示的。但是,other 浏览器中仍会打开一个新选项卡。
%matplotlib inline
from bokeh.plotting import figure, show, output_notebook
from bokeh.sampledata.iris import flowers
output_notebook()
colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
colors = [colormap[x] for x in flowers['species']]
p = figure(title = "Iris Morphology")
p.xaxis.axis_label = 'Petal Length'
p.yaxis.axis_label = 'Petal Width'
p.circle(flowers["petal_length"], flowers["petal_width"],
color=colors, fill_alpha=0.2, size=10)
# output_file("iris.html", title="iris.py example")
show(p)
【问题讨论】:
标签: jupyter jupyter-lab