plotly.figure_factory.create_scatterplot停止工作了吗? [英] plotly.figure_factory.create_scatterplot stopped working?

查看:325
本文介绍了plotly.figure_factory.create_scatterplot停止工作了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当时正在使用plotly尝试一些操作,然后发现create_scatterplot是唯一不起作用的软件包. 我的意思是,它显然在模块中,正如您在调用help命令时所显示的那样:

I was using plotly to try some things and then found that create_scatterplot is the only package that doesn't work. I mean, it clearly is in the module, as it appears when you call the help command:

NAME
plotly.figure_factory

FILE
     /usr/lib/python2.7/site-packages/plotly/figure_factory/__init__.py

 PACKAGE CONTENTS
    _2d_density
    _annotated_heatmap
    _bullet
    _candlestick
    _county_choropleth
    _dendrogram
    _distplot
    _facet_grid
    _gantt
    _ohlc
    _quiver
    _scatterplot
    _streamline
    _table
 :

在plotly.py/plotly/figure_factory github文件夹中

它下来了吗?我对编程很陌生,但是我认为这种事情仍然局限于本地.也许我正在丢失一些东西,我可以解决这个问题吗?

Is it down or something? I am quite new to programming, but I thought this kind of thing stayed local. Maybe I am losing something, can i fix this?

如果要检查一些代码:

from plotly import figure_factory as ff
help(ff)
from plotly.figure_factory import create_2d_density
from plotly.figure_factory import create_annotated_heatmap
from plotly.figure_factory import create_bullet
from plotly.figure_factory import create_candlestick
from plotly.figure_factory import create_county_choropleth
from plotly.figure_factory import create_dendrogram
from plotly.figure_factory import create_facet_grid
from plotly.figure_factory import create_gantt
from plotly.figure_factory import create_ohlc
from plotly.figure_factory import create_quiver
from plotly.figure_factory import create_scatterplot
from plotly.figure_factory import create_streamline
from plotly.figure_factory import create_table

您可以看到它只返回散点图和county_choropleth错误.

And you can see it only returns errors with scatterplot and county_choropleth.

推荐答案

我在github plotly.figure_factory的

As I see in github plotly.figure_factory at _county_choropleth you need just call this in another way:

from plotly.figure_factory._county_choropleth import create_choropleth

然后致电:

fig = create_choropleth(bla-bla)
py.plot(fig, filename='basic-choropleth')

scatterplot 的情况下,您只需将create_scatterplot重命名为scatterplot:

In situation with scatterplot you will need rename create_scatterplot to just scatterplot:

from plotly.figure_factory._scatterplot import scatterplot

和:

fig = scatterplot(bla-bla)
py.plot(fig, filename='basic-scatter')

我还发现,当您致电create_choropleth时,您需要安装一些软件包链接避免麻烦:

Also I found that when you called create_choropleth you need to install few packages link to avoid troubles:

pip install shapely
pip install geopandas
pip install pyshp

别忘了更新您的绘图版本:

And don`t forget to update your plotly version:

pip install --upgrade plotly

希望这些信息可以为您提供帮助

Hope this information could help you

这篇关于plotly.figure_factory.create_scatterplot停止工作了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆