9.2. Demand Profiles
- plotter.plot_demand_profiles(peak_drift_list, peak_accel_list, control_nodes, title=None, pFlag=True, export_path=None)[source]
Generate demand profile plots for peak storey drifts and peak floor accelerations.
This method creates two side-by-side plots:
A plot of peak storey drift (%), displaying how the drift ratio varies with floor number.
A plot of peak floor acceleration (g), displaying how the acceleration varies with floor number.
The data is presented as lines representing each control node’s response at different floors.
The figure uses
self.figsizewith fixed axes margins and is saved withoutbbox_inches='tight'so that every output image has identical, deterministic pixel dimensions.- Parameters:
peak_drift_list (list of np.ndarray) – A list of arrays where each array contains peak drift values for each floor, with the first column being the drift values and the second column being the floor numbers.
peak_accel_list (list of np.ndarray) – A list of arrays where each array contains peak acceleration values for each floor, with the first column being the acceleration values and the second column being the floor numbers.
control_nodes (list) – A list of floor numbers or nodes that represent the control points in the structure.
title (str, optional) – Custom plot title.
pFlag (bool, optional, default=True) – If True, the plot is processed (saved/shown).
export_path (str, optional) – Full path including filename to save the plot. Creates directories if missing.
- Returns:
This function saves the plot to a file in the specified output directory.
- Return type:
None
Example
from openquake.vmtk.plotter import plotter
pl = plotter()
# peak_drift_list, peak_accel_list: one entry per record, from the
# ``peak_drift`` / ``peak_accel`` outputs of ``do_nrha_analysis``
pl.plot_demand_profiles(
peak_drift_list,
peak_accel_list,
control_nodes,
pFlag=True,
export_path="demand_profiles.png",
)