python-3.x - 情节图不可见
问题描述
我在 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
解决方案
推荐阅读
- sql - Oracle SQL 选择将“城市、州”拆分为两列(仅包含州和没有逗号的一些实例)并修剪空格
- javascript - 在 Safari IOS 13.3 中打开新标签
- java - 如何使用 Lombok + Gson 创建 JSON 对象数组?
- python - 我有一段很长的代码,它在 python 3.7 中使用 x[0]=2 等定义了一个列表。为什么它不起作用?
- .net-core - 具有多个环境的 Azure 管道
- laravel - 如何使用分页和过滤加载包含产品的类别页面?拉拉维尔
- python - 如何结合数据框(熊猫)列在 Seaborn 箱形图中绘制置信区间?
- c# - C# ExcelDataReader.Exceptions.HeaderException: '无效的文件签名。'
- php - 如何将 TAB 复制到剪贴板
- r - 如何在 R 中使用置信区间格式化 beta0 和 beta1?