code: def plot_losses(calc_id, bins=7):
      
      # read the hazard data
      dstore = util.read(calc_id)
      losses_by_rlzi = dict(extract(dstore, 'losses_by_event'))
      oq = dstore['oqparam']
      plt = make_figure(losses_by_rlzi, oq.loss_dt().names, bins)
      plt.show()
docs: losses_by_event plotter