情节情节不可见

Plotly plot is not visible

我在 jupyter-lab 中遇到绘图问题。主要是情节。当我执行代码时,未显示绘图。我该怎么办?我怎样才能让情节可见?

示例代码:

import plotly.graph_objects as go

from datetime import datetime

open_data = [33.0, 33.3, 33.5, 33.0, 34.1]
high_data = [33.1, 33.3, 33.6, 33.2, 34.8]
low_data = [32.7, 32.7, 32.8, 32.6, 32.8]
close_data = [33.0, 32.9, 33.3, 33.1, 33.1]
dates = [datetime(year=2013, month=10, day=10),
         datetime(year=2013, month=11, day=10),
         datetime(year=2013, month=12, day=10),
         datetime(year=2014, month=1, day=10),
         datetime(year=2014, month=2, day=10)]

fig = go.Figure(data=[go.Ohlc(x=dates,
                          open=open_data, high=high_data,
                          low=low_data, close=close_data)])
fig.show()

和输出屏幕:

jupyter labextension 列表:

(base) C:\Users\Dell>jupyter labextension list
JupyterLab v3.0.11
C:\Users\Dell\anaconda3\share\jupyter\labextensions
        atoti-jupyterlab v0.5.4 enabled ok
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)
        @pyviz/jupyterlab_pyviz v2.0.1 enabled ok (python, pyviz_comms)

jupyter 服务器扩展列表:

(base) C:\Users\Dell>jupyter server extension list
Config dir: C:\Users\Dell\.jupyter

Config dir: C:\Users\Dell\anaconda3\etc\jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.11 ok
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  ok

Config dir: C:\ProgramData\jupyter

效果很好。 我检查过我这边。 请检查这个。