Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

mapping with geopandas

import geopandas as gpd
print(gpd.__version__)   ## 0.5
import numpy as np; np.random.seed(42)
import matplotlib.pyplot as plt 

gdf = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) 
gdf['quant']=np.random.rand(len(gdf))*100-20

fig, ax = plt.subplots()

gdf.plot(column='quant', cmap='RdBu', scheme="User_Defined", 
         legend=True, classification_kwds=dict(bins=[-10,20,30,50,70]),
         ax=ax)

plt.show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mapping #geopandas
ADD COMMENT
Topic
Name
1+9 =