jupyter plotly画图不显示

您所在的位置:网站首页 plotly安装不成功 jupyter plotly画图不显示

jupyter plotly画图不显示

2023-11-08 18:07| 来源: 网络整理| 查看: 265

很多帖子说加%matplotlib inline在jupyter能用,kaggle kernel还是一片白色,原代码: from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import cufflinks as cf cf.go_offline()###这两句是离线生成图片的设置 cf.set_config_file(offline=True, world_readable=True) 根据https://www.jianshu.com/p/1d8a51867946 添加init_notebook_mode(connected=True)后解决 即 from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import cufflinks as cf init_notebook_mode(connected=True) cf.go_offline() cf.set_config_file(offline=True, world_readable=True)

原因可能是: plotly分在线生成图片和离线生成图片两种形式。 在线生成图片需要在plotly官网上申请一个账户,并在自己的账户中生成一个api_key,然后使用必须加上下面两行语句。注意免费账户在线生成图片时在你的账户里会保存这个图片,免费账户每天限制在线生成100张图片,且sharing不能设为private,world_readable必须设为True。

plotly.tools.set_credentials_file(username=’’, api_key=’’) ##免费账户在线生成图片sharing不能设为private,world_readable必须设为True plotly.tools.set_config_file(world_readable=True)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3