boston_data = "/Users/jean-francoisrajotte/projects/street_lang/boston_massachusetts/boston_massachusetts-roads.geojson"
btesting = False
boston = street_languages.City(boston_data, 'Boston', btesting)
boston.set_language_stats()
import mplleaflet
cdict1 = {'red': ((0.0, 0.0, 0.0),
(1.0, 0.0, 0.0)),
'green': ((0.0, 0.0, 0.0),
(1.0, 0.0, 0.0)),
'blue': ((0.0, 0.0, 1.0),
(1.0, 0.0, 0.0))
}
cdict2 = {'red': ((0.0, 0.0, 1.0),
(1.0, 0.0, 0.0)),
'green': ((0.0, 0.0, 0.0),
(1.0, 0.0, 0.0)),
'blue': ((0.0, 0.0, 0.0),
(1.0, 0.0, 0.0))
}
blues = LinearSegmentedColormap('BlueRed2', cdict1)
reds = LinearSegmentedColormap('BlueRed2', cdict2)
boston.df[boston.df['lang']<0].plot(colormap=reds)
boston.df[boston.df['lang']>0].plot(colormap=blues)
mplleaflet.display()