In [1]:
import pysal.lib 
import geopandas as gpd
from pysal.viz import mapclassify as mc

In [2]:
columbus = gpd.read_file(pysal.lib.examples.get_path('columbus.shp'))

In [3]:
q5 = mc.Quantiles(columbus.CRIME, k=5)

In [4]:
q5


Out[4]:
               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

In [5]:
q5.plot(columbus)


Out[5]:
(<Figure size 640x480 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f893be186d8>)

In [6]:
q5.plot(columbus, axis_on=False)


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

In [7]:
q5.plot(columbus, axis_on=False, cmap='Blues')


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

In [8]:
f = q5.plot(columbus, axis_on=False, cmap='Blues')



In [9]:
f = q5.plot(columbus, axis_on=False, cmap='Blues', title='Columbus, OH')



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



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



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



In [13]:
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')



In [15]:
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)



In [ ]: