Creating a heat map

Use the HeatmapViz class to generate a heat map from the data:

measure = 'Female Population'
heatmap_color_stops = create_color_stops([0.01, 0.25, 0.5, 0.75, 1], colors='PuRd')
heatmap_radius_stops = [[0, 3], [14, 100]]
color_breaks = [round(tract_poly[measure].quantile(q=x*0.1), 2) for x in range(2,10)]
color_stops = create_color_stops(color_breaks, colors='Spectral')
heatmap_weight_stops = create_weight_stops(color_breaks)
vizheat = HeatmapViz('tracts_points2.geojson',
access_token=token,
weight_property = "Female Population",
weight_stops = heatmap_weight_stops,
color_stops = heatmap_color_stops,
radius_stops = heatmap_radius_stops,
opacity = 0.8,
center=(-122, 37.78),
zoom=7,
below_layer='waterway-label'
)
vizheat.show()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset