Interactive Result Plotting

Interactive Folium map graphics can be generated using the function plot_interactive_map(). This function produces an interactive map using Folium, an open-source Python library for generating Leaflet maps. More information on Folium can be found at https://python-visualization.github.io/folium/. The map generated will overlay the node data onto a Leaflet map.

The following example demonstrates how to plot node damage data:

 >>> import pandas as pd
 >>> from folium import Map
 >>> # Load or prepare node data
 >>> result_bldg = pd.DataFrame({
 ...     'x': [-106.6851, -106.5073, -106.6123],
 ...     'y': [35.1344, 35.0713, 35.0844],
 ...     'dmg': [0.1, 0.5, 0.9]
 ... })
 >>> # Extract node coordinates and damage attributes
 >>> node = result_bldg.loc[:, 'x':'y']
 >>> node_dmg = result_bldg.loc[:, 'dmg']
 >>> # Plot damage map
 >>> map = plot_interactive_map(node, node_dmg, node_size=5, node_cmap_bins='cut')
 >>> map.save('interactive_plot.png')

Interactive Folium map graphic.
The interactive Leaflet network graphic is included below.

Fig 6. Interactive Map on OpenStreetMap.