gpt4 book ai didi

machine-learning - 绘图显示 AWS Sagemaker JupyterLab 中的空白图表

转载 作者:行者123 更新时间:2023-12-03 19:14:31 24 4
gpt4 key购买 nike

背景:我是 Python 世界的新手,正在使用 Plotly 在 Python 中创建基本图形。我正在使用 AWS Sagemaker 的 JupyterLab 创建 python 脚本。

问题:我一直在尝试运行 Plotly 网站上提到的基本代码,但即使是那些也返回空白图形。

问题解决我自己尝试过:

  • pip 安装了 4.6.0 版
  • https://plotly.com/python/getting-started/上提到的步骤JupyterLab 支持已经执行

  • 代码示例:
    import plotly.graph_objects as go
    fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
    fig.show()

    最佳答案

    我最近有同样的问题。建议简单更改 here帮助过我。我知道这是一个临时解决方法,直到找到正确的修复方法。

    // fig = go.Figure()
    fig = go.FigureWidget() // replace with this
    // fig.show()
    fig // remove .show()

    关于machine-learning - 绘图显示 AWS Sagemaker JupyterLab 中的空白图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61214419/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com