import pysal.lib 
import geopandas as gpd
from pysal.viz import mapclassify as mc

columbus = gpd.read_file(pysal.lib.examples.get_path('columbus.shp'))

q5 = mc.Quantiles(columbus.CRIME, k=5)

q5

               Quantiles                
 
Lower            Upper             Count
========================================
         x[i] <= 19.023               10
19.023 < x[i] <= 29.326               10
29.326 < x[i] <= 39.025                9
39.025 < x[i] <= 53.161               10
53.161 < x[i] <= 68.892               10
q5.plot(columbus)

(<Figure size 640x480 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f893be186d8>)
q5.plot(columbus, axis_on=False)

(<Figure size 432x288 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f893bb0acc0>)

png

q5.plot(columbus, axis_on=False, cmap='Blues')

(<Figure size 432x288 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f893ba1bb70>)

png

f = q5.plot(columbus, axis_on=False, cmap='Blues')

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH')

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH', \
           legend=True)

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH', \
           legend=True, legend_kwds={'loc':'upper right'})

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH', \
           legend=True, legend_kwds={'loc':'upper left', 'title': 'Crime Rate'})

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH', \
           legend=True, legend_kwds={'loc':'upper left', 'title': 'Crime Rate'}, \
           file_name='crime.png')

png

f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH', \
           legend=True, legend_kwds={'loc':'upper left', 'title': 'Crime Rate, 1988'}, \
           file_name='crime.png', border_color='green', border_width=2.0)

png