code: def _single_metric_traces(
      model: ModelBridge,
      metric: str,
      generator_runs_dict: TNullableGeneratorRunsDict,
      rel: bool,
      show_arm_details_on_hover: bool = True,
      showlegend: bool = True,
      show_CI: bool = True,
      arm_noun: str = "arm",
      fixed_features: Optional[ObservationFeatures] = None,
      data_selector: Optional[Callable[[Observation], bool]] = None,
      scalarized_metric_config: Optional[List[Dict[str, Any]]] = None,
  ) -> Traces:
      """Plot scatterplots with errors for a single metric (y-axis).
  
      Arms are plotted on the x-axis.
  
      Args:
          model: model to draw predictions from.
          metric: name of metric to plot.
          generator_runs_dict: a mapping from
              generator run name to generator run.
          rel: if True, plot relative predictions.
          show_arm_details_on_hover: if True, display
              parameterizations of arms on hover. Default is True.
          show_legend: if True, show legend for trace.
          show_CI: if True, render confidence intervals.
          arm_noun: noun to use instead of "arm" (e.g. group)
          fixed_features: Fixed features to use when making model predictions.
          data_selector: Function for selecting observations for plotting.
          scalarized_metric_config: An optional list of dicts specifying how to aggregate
              multiple metrics into a single scalarized metric. For each dict, the key is
              the name of the new scalarized metric, and the value is a dictionary mapping
              each metric to its weight. e.g.
              {"name": "metric1:agg", "weight": {"metric1_c1": 0.5, "metric1_c2": 0.5}}.
      """
      plot_data, _, _ = get_plot_data(
          model,
          generator_runs_dict or {},
          {metric},
          fixed_features=fixed_features,
          data_selector=data_selector,
          scalarized_metric_config=scalarized_metric_config,
      )
  
      status_quo_arm = (
          None
          if plot_data.status_quo_name is None
          else plot_data.in_sample.get(plot_data.status_quo_name)
      )
  
      traces = [
          _error_scatter_trace(
              list(plot_data.in_sample.values()),
              x_axis_var=None,
              y_axis_var=PlotMetric(metric, pred=True, rel=rel),
              status_quo_arm=status_quo_arm,
              legendgroup="In-sample",
              showlegend=showlegend,
              show_arm_details_on_hover=show_arm_details_on_hover,
              show_CI=show_CI,
              arm_noun=arm_noun,
          )
      ]
  
      # Candidates
      for i, (generator_run_name, cand_arms) in enumerate(
          (plot_data.out_of_sample or {}).items(), start=1
      ):
          traces.append(
              _error_scatter_trace(
                  list(cand_arms.values()),
                  x_axis_var=None,
                  y_axis_var=PlotMetric(metric, pred=True, rel=rel),
                  status_quo_arm=status_quo_arm,
                  name=generator_run_name,
                  color=DISCRETE_COLOR_SCALE[i],
                  legendgroup=generator_run_name,
                  showlegend=showlegend,
                  show_arm_details_on_hover=show_arm_details_on_hover,
                  show_CI=show_CI,
                  arm_noun=arm_noun,
              )
          )
      return traces
  
imports: import numbers
  import warnings
  from collections import OrderedDict
  from logging import Logger
  from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
  import numpy
  import plotly.graph_objs
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.observation import Observation, ObservationFeatures
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.registry import Models
  from ax.plot.base import AxPlotConfig, AxPlotTypes, CI_OPACITY, DECIMALS, PlotInSampleArm, PlotMetric, PlotOutOfSampleArm, Z
  from ax.plot.color import BLUE_SCALE, COLORS, DISCRETE_COLOR_SCALE, rgba
  from ax.plot.helper import _format_CI, _format_dict, _wrap_metric, arm_name_to_sort_key, arm_name_to_tuple, get_plot_data, infer_is_relative, resize_subtitles, TNullableGeneratorRunsDict
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast_optional
  from ax.utils.stats.statstools import relativize
  from plotly import subplots
label_desc: Use image node_id 9 for calling a global function with example usage: _single_metric_traces(model, metric, generator_runs_dict, rel, show_arm_details_on_hover, showlegend, show_CI, arm_noun, fixed_features, data_selector, scalarized_metric_config) and returns: traces