code: def test_plot_pareto_front_3d(
      include_dominated_trials: bool, axis_order: Optional[List[int]]
  ) -> None:
      # Test with no trial.
      study = optuna.multi_objective.create_study(
          ["minimize", "minimize", "minimize"]
      )
      figure = plot_pareto_front(
          study,
          include_dominated_trials=include_dominated_trials,
          axis_order=axis_order,
      )
      assert len(figure.data) == 1
      assert figure.data[0]["x"] == ()
      assert figure.data[0]["y"] == ()
      assert figure.data[0]["z"] == ()
  
      # Test with three trials.
      study.enqueue_trial({"x": 1, "y": 1, "z": 1})
      study.enqueue_trial({"x": 1, "y": 0, "z": 1})
      study.enqueue_trial({"x": 1, "y": 1, "z": 0})
      study.optimize(
          lambda t: [
              t.suggest_int("x", 0, 1),
              t.suggest_int("y", 0, 1),
              t.suggest_int("z", 0, 1),
          ],
          n_trials=3,
      )
  
      figure = plot_pareto_front(
          study,
          include_dominated_trials=include_dominated_trials,
          axis_order=axis_order,
      )
      assert len(figure.data) == 1
      data: List[Tuple[int, ...]]
      if include_dominated_trials:
          # The last elements come from dominated trial that is enqueued firstly.
          data = [(1, 1, 1), (0, 1, 1), (1, 0, 1)]
          if axis_order is None:
              assert figure.data[0]["x"] == data[0]
              assert figure.data[0]["y"] == data[1]
              assert figure.data[0]["z"] == data[2]
          else:
              assert figure.data[0]["x"] == data[axis_order[0]]
              assert figure.data[0]["y"] == data[axis_order[1]]
              assert figure.data[0]["z"] == data[axis_order[2]]
      else:
          data = [(1, 1), (0, 1), (1, 0)]
          if axis_order is None:
              assert figure.data[0]["x"] == data[0]
              assert figure.data[0]["y"] == data[1]
              assert figure.data[0]["z"] == data[2]
          else:
              assert figure.data[0]["x"] == data[axis_order[0]]
              assert figure.data[0]["y"] == data[axis_order[1]]
              assert figure.data[0]["z"] == data[axis_order[2]]
  
      titles = ["Objective {}".format(i) for i in range(3)]
      if axis_order is None:
          assert figure.layout.scene.xaxis.title.text == titles[0]
          assert figure.layout.scene.yaxis.title.text == titles[1]
          assert figure.layout.scene.zaxis.title.text == titles[2]
      else:
          assert (
              figure.layout.scene.xaxis.title.text
              == titles[axis_order[0]]
          )
          assert (
              figure.layout.scene.yaxis.title.text
              == titles[axis_order[1]]
          )
          assert (
              figure.layout.scene.zaxis.title.text
              == titles[axis_order[2]]
          )
  
      # Test with `names` argument.
      with pytest.raises(ValueError):
          plot_pareto_front(
              study,
              names=[],
              include_dominated_trials=include_dominated_trials,
              axis_order=axis_order,
          )
  
      with pytest.raises(ValueError):
          plot_pareto_front(
              study,
              names=["Foo"],
              include_dominated_trials=include_dominated_trials,
              axis_order=axis_order,
          )
  
      with pytest.raises(ValueError):
          plot_pareto_front(
              study,
              names=["Foo", "Bar"],
              include_dominated_trials=include_dominated_trials,
              axis_order=axis_order,
          )
  
      with pytest.raises(ValueError):
          plot_pareto_front(
              study,
              names=["Foo", "Bar", "Baz", "Qux"],
              include_dominated_trials=include_dominated_trials,
              axis_order=axis_order,
          )
  
      names = ["Foo", "Bar", "Baz"]
      figure = plot_pareto_front(
          study, names=names, axis_order=axis_order
      )
      if axis_order is None:
          assert figure.layout.scene.xaxis.title.text == names[0]
          assert figure.layout.scene.yaxis.title.text == names[1]
          assert figure.layout.scene.zaxis.title.text == names[2]
      else:
          assert (
              figure.layout.scene.xaxis.title.text
              == names[axis_order[0]]
          )
          assert (
              figure.layout.scene.yaxis.title.text
              == names[axis_order[1]]
          )
          assert (
              figure.layout.scene.zaxis.title.text
              == names[axis_order[2]]
          )
  
file_path: optuna/tests/multi_objective_tests/visualization_tests/test_pareto_front.py
imports: import itertools
  from typing import List
  from typing import Optional
  from typing import Tuple
  import numpy
  import pytest
  import optuna
  from optuna.multi_objective.visualization import plot_pareto_front
label_desc: Use image node_id 2 for calling a global function with example usage: test_plot_pareto_front_3d(include_dominated_trials, axis_order) without return types