code: def _collect_output_plots(
      repo, targets, props, onerror: Optional[Callable] = None
  ):
      fs = repo.dvcfs
      result: Dict[str, Dict] = {}
      for plot in repo.index.plots:
          plot_props = _plot_props(plot)
          dvcfile = plot.stage.dvcfile
          config_path = _relpath(fs, dvcfile.path)
          wdir_relpath = _relpath(fs, plot.stage.wdir)
          if _matches(targets, config_path, str(plot)):
              unpacked = unpack_if_dir(
                  fs,
                  _normpath(fs.join(wdir_relpath, plot.def_path)),
                  props={**plot_props, **props},
                  onerror=onerror,
              )
  
              dpath.merge(
                  result,
                  {"": unpacked},
              )
      return result
  
imports: import csv
  import io
  import os
  from collections import defaultdict
  from copy import deepcopy
  from functools import partial
  from multiprocessing import cpu_count
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Set, Union
  import dpath
  import dpath.options
  from funcy import first, ldistinct, project, reraise
  from dvc.exceptions import DvcException
  from dvc.log import logger
  from dvc.utils import error_handler, errored_revisions
  from dvc.utils.objects import cached_property
  from dvc.utils.serialize import PARSERS, EncodingError
  from dvc.utils.threadpool import ThreadPoolExecutor
  from dvc_render.image import ImageRenderer
label_desc: Use image node_id 11 for calling a global function with example usage: _collect_output_plots(repo, targets, props, onerror) and returns: result