您好,亲爱的Stack社区,我正在学习使用以下代码在带有geopandas包的Spyder IDE中创建“分层”地图:
import geopandas as geopandas
import matplotlib.pyplot as plt
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
cities = geopandas.read_file(geopandas.datasets.get_path('naturalearth_cities'))
world.plot()
ax = plt.subplot(1, 1)
world.plot(column='pop_est', ax=ax, legend=True)
我像RStudio一样逐行执行代码。不幸的是,我只能获得一张白色的空白纸,而不是一张地图。
谢谢。