In [9]:
import geopandas as gp
In [10]:
# we use PySAL for loading a test shapefile
# replace this cell if you have a local shapefile and want to use GeoPandas readers
import pysal as ps
pth = ps.examples.get_path("columbus.shp")
tracts = gp.GeoDataFrame.from_file(pth)
In [11]:
tracts.plot(column='CRIME', scheme='QUANTILES', k=3, colormap='OrRd')
Out[11]:
In [12]:
tracts.plot(column='CRIME', scheme='Unrecognized', k=3, colormap='OrRd')
Out[12]:
In [12]:
In [13]:
tracts.plot(column='CRIME', scheme='QUANTILES', k=1, colormap='OrRd')
Out[13]:
In [14]:
tracts.plot(column='CRIME', scheme='fisher_jenks', k=8, colormap='OrRd')
Out[14]:
In [15]:
tracts.plot(column='CRIME', scheme='equal_interval', k=7, colormap='OrRd')
Out[15]:
In [16]:
tracts.plot(column='CRIME', scheme='equal_interval', k=12, colormap='OrRd')
Out[16]:
This is only using a subset of the classifiers in PySAL. specifically those that take only an attribute and a value of k as an argument. This simplifies the number of new default parameters that would be required in GeoPandas.DataFrame.plot().
It is of course possible to add other classifiers with the cost of additional kw args.
In [ ]: