首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我看不到两层使用熊猫bokeh?

为什么我看不到两层使用熊猫bokeh?
EN

Stack Overflow用户
提问于 2019-05-18 19:31:31
回答 1查看 141关注 0票数 0

我正在尝试按照建议的here使用pandas_bokeh

代码语言:javascript
复制
import geopandas as gpd
import pandas_bokeh
pandas_bokeh.output_notebook()

# Read in GeoJSONs from URL:
df_states = gpd.read_file(r"https://raw.githubusercontent.com/PatrikHlobil/Pandas-Bokeh/master/Documentation/Testdata/states/states.geojson")
df_cities = gpd.read_file(
    r"https://raw.githubusercontent.com/PatrikHlobil/Pandas-Bokeh/master/Documentation/Testdata/populated%20places/ne_10m_populated_places_simple_bigcities.geojson"
)
df_cities["size"] = df_cities.pop_max / 400000

#Plot shapes of US states (pass figure options to this initial plot):
figure = df_states.plot_bokeh(
    figsize=(800, 450),
    simplify_shapes=10000,
    show_figure=False,
    xlim=[-170, -80],
    ylim=[10, 70],
    category="REGION",
    colormap="Dark2",
    legend="States",
    show_colorbar=False,
)

#Plot cities as points on top of the US states layer by passing the figure:
df_cities.plot_bokeh(
    figure=figure,         # <== pass figure here!
    category="pop_max",
    colormap="Viridis",
    colormap_uselog=True,
    size="size",
    hovertool_string="""<h1>@name</h1>
                        <h3>Population: @pop_max </h3>""",
    marker="inverted_triangle",
    legend="Cities",
)

但是,这是图层State不可见的输出

EN

回答 1

Stack Overflow用户

发布于 2019-06-01 20:15:54

这是一个从Bokeh1.1 (https://github.com/PatrikHlobil/Pandas-Bokeh/issues/22)开始出现的已知错误。在当前的开发版本中,该错误已修复。您可以使用以下命令进行安装:

代码语言:javascript
复制
pip install git+https://github.com/PatrikHlobil/Pandas-Bokeh.git

希望这能解决你的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56198526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档