code: def make_figure_hcurves(extractors, what):
      
      import matplotlib.pyplot as plt
      fig = plt.figure()
      got = {}  # (calc_id, kind) -> curves
      for i, ex in enumerate(extractors):
          hcurves = ex.get(what)
          for kind in hcurves.kind:
              got[ex.calc_id, kind] = hcurves[kind]
      oq = ex.oqparam
      n_imts = len(hcurves.imt)
      [site] = hcurves.site_id
      for j, imt in enumerate(hcurves.imt):
          imls = oq.imtls[imt]
          imt_slice = oq.imtls(imt)
          ax = fig.add_subplot(n_imts, 1, j + 1)
          ax.set_xlabel('%s, site %s, inv_time=%dy' %
                        (imt, site, oq.investigation_time))
          ax.set_ylabel('PoE')
          for ck, arr in got.items():
              if (arr == 0).all():
                  logging.warning('There is a zero curve %s_%s', *ck)
              ax.loglog(imls, arr[0, imt_slice], '-', label='%s_%s' % ck)
              ax.loglog(imls, arr[0, imt_slice], '.')
          ax.grid(True)
          ax.legend()
      return plt
docs: $ oq plot 'hcurves?kind=mean&imt=PGA&site_id=0'