code: def _get_pareto_front_2d(
      study: MultiObjectiveStudy,
      names: Optional[List[str]],
      include_dominated_trials: bool = False,
      axis_order: Optional[List[int]] = None,
  ) -> "go.Figure":
      if names is None:
          names = ["Objective 0", "Objective 1"]
      elif len(names) != 2:
          raise ValueError("The length of `names` is supposed to be 2.")
  
      trials = study.get_pareto_front_trials()
      if len(trials) == 0:
          _logger.warning(
              "Your study does not have any completed trials."
          )
  
      point_colors = ["blue"] * len(trials)
      if include_dominated_trials:
          non_pareto_trials = _get_non_pareto_front_trials(
              study, trials
          )
          point_colors += ["red"] * len(non_pareto_trials)
          trials += non_pareto_trials
  
      if axis_order is None:
          axis_order = list(range(2))
      else:
          if len(axis_order) != 2:
              raise ValueError(
                  f"Size of `axis_order` {axis_order}. Expect: 2, Actual: {len(axis_order)}."
              )
          if len(set(axis_order)) != 2:
              raise ValueError(
                  f"Elements of given `axis_order` {axis_order} are not unique!"
              )
          if max(axis_order) > 1:
              raise ValueError(
                  f"Given `axis_order` {axis_order} contains invalid index {max(axis_order)} "
                  "higher than 1."
              )
          if min(axis_order) < 0:
              raise ValueError(
                  f"Given `axis_order` {axis_order} contains invalid index {min(axis_order)} "
                  "lower than 0."
              )
  
      data = go.Scatter(
          x=[t.values[axis_order[0]] for t in trials],
          y=[t.values[axis_order[1]] for t in trials],
          text=[_make_hovertext(t) for t in trials],
          mode="markers",
          hovertemplate="%{text}<extra></extra>",
          marker={"color": point_colors},
      )
      layout = go.Layout(
          title="Pareto-front Plot",
          xaxis_title=names[axis_order[0]],
          yaxis_title=names[axis_order[1]],
      )
      return go.Figure(data=data, layout=layout)
  
file_path: optuna/optuna/multi_objective/visualization/_pareto_front.py
imports: import json
  from typing import List
  from typing import Optional
  import optuna
  from optuna import multi_objective
  from optuna._deprecated import deprecated_func
  from optuna.multi_objective.study import MultiObjectiveStudy
  from optuna.multi_objective.trial import FrozenMultiObjectiveTrial
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import _imports
label_desc: Use image node_id 3 for calling a global function with example usage: _get_pareto_front_2d(study, names, include_dominated_trials, axis_order) and returns: go