Jon Reades - j.reades@ucl.ac.uk
1st October 2025
For this one, you really need to read the docs.
And some nice chaining…
import pysal as ps
# https://github.com/pysal/mapclassify
import mapclassify as mc
# https://jiffyclub.github.io/palettable/
import palettable.matplotlib as palmpl
from legendgram import legendgram
f,ax = plt.subplots(figsize=(10,8))
gdf.plot(column='price', scheme='Quantiles', cmap='magma', k=5, ax=ax)
q = mc.Quantiles(gdf.price.array, k=5)
# https://github.com/pysal/legendgram/blob/master/legendgram/legendgram.py
legendgram(f, ax,
gdf.price, q.bins, pal=palmpl.Magma_5,
legend_size=(.4,.2), # legend size in fractions of the axis
loc = 'upper left', # mpl-style legend loc
clip = (0,500), # clip range of the histogram
frameon=True)
name | price | w_price | |
---|---|---|---|
83 | Southfields Home | 85.0 | 263.0 |
53 | Flat in Islington, Central London | 55.0 | 190.0 |
70 | 3bedroom Family Home minutes from Kensington Tube | 221.0 | 470.0 |
453 | Bed, 20 min to Liverpool st, EAST LONDON | 110.0 | 186.0 |
44 | Avni Kensington Hotel | 430.0 | 821.0 |
name | price_std | w_price_std | |
---|---|---|---|
83 | Southfields Home | -0.27 | 0.00 |
53 | Flat in Islington, Central London | -0.51 | -0.58 |
70 | 3bedroom Family Home minutes from Kensington Tube | 0.83 | 0.46 |
453 | Bed, 20 min to Liverpool st, EAST LONDON | -0.07 | -0.82 |
44 | Avni Kensington Hotel | 2.52 | 3.25 |
name | price | sig | quad | |
---|---|---|---|---|
83 | Southfields Home | 85.0 | False | 3 |
53 | Flat in Islington, Central London | 55.0 | False | 3 |
70 | 3bedroom Family Home minutes from Kensington Tube | 221.0 | False | 1 |
453 | Bed, 20 min to Liverpool st, EAST LONDON | 110.0 | False | 3 |
44 | Avni Kensington Hotel | 430.0 | False | 1 |
There’s so much more to find, but: