Почему я не вижу двух слоев, используя панды боке? - PullRequest
0 голосов
/ 18 мая 2019

Я пытаюсь использовать pandas_bokeh как предложено здесь

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 не виден

enter image description here

1 Ответ

0 голосов
/ 01 июня 2019

Это известная ошибка, которая начала возникать с Bokeh 1.1 (https://github.com/PatrikHlobil/Pandas-Bokeh/issues/22). В текущей версии разработки ошибка исправлена. Вы можете установить ее, используя:

pip install git+https://github.com/PatrikHlobil/Pandas-Bokeh.git

Надеюсь, это исправит вашу ошибкупроблема.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...