Plot Damage Distribution

This IPython notebook allows the user to create bar plots of the damage distribution results obtained from a scenario damage analysis, and to export the plots as png files. Damage distribution per taxonomy as well as total damage distribution results can be visualised using this notebook. The bar plots show the estimated mean and standard deviation of the number of buildings in each damage state.

Damage distribution per taxonomy

Please specify below the path of the xml file containing the damage distribution results.

In the taxonomy_list, please provide a list of the building taxonomies for which damage distribution plots are needed (e.g. taxonomy_list=["W", "A", "RC"]). The taxonomy strings should match the taxonomies in the fragility model used for running the analysis. If no taxonomies are listed (taxonomy_list=[]), the notebook script will attempt to plot the damage distribution results for all of the taxonomies used in the analysis.

Setting the plot_3d flag in the cell below to True will generate a 3D bar plot (Note: Using this option will plot the damage fractions for each taxonomy instead of the number of assets in each damage state, to allow for a comparison of the damage distribution between different taxonomies).

In [ ]:
%matplotlib inline
import plot_damage_dist as plotdd
tax_dmg_dist_file = '../sample_outputs/scenario_damage/dmg_dist_per_taxonomy.xml'

plot_3d = True
plot_no_damage = False

plotdd.plot_taxonomy_damage_dist(tax_dmg_dist_file, taxonomy_list, plot_no_damage, plot_3d)

Total damage distribution

Please specify below the path of the xml file containing the total damage distribution results.

In [ ]:
total_dmg_dist_file = '../sample_outputs/scenario_damage/dmg_dist_total.xml'
plot_no_damage = False

plotdd.plot_total_damage_dist(total_dmg_dist_file, plot_no_damage)