code: def plot_slice(
      study: Study,
      params: list[str] | None = None,
      *,
      target: Callable[[FrozenTrial], float] | None = None,
      target_name: str = "Objective Value",
  ) -> "go.Figure":
      """Plot the parameter relationship as slice plot in a study.
  
      Note that, if a parameter contains missing values, a trial with missing values is not plotted.
  
      Example:
  
          The following code snippet shows how to plot the parameter relationship as slice plot.
  
          .. plotly::
  
              import optuna
  
  
              def objective(trial):
                  x = trial.suggest_float("x", -100, 100)
                  y = trial.suggest_categorical("y", [-1, 0, 1])
                  return x ** 2 + y
  
  
              sampler = optuna.samplers.TPESampler(seed=10)
              study = optuna.create_study(sampler=sampler)
              study.optimize(objective, n_trials=10)
  
              fig = optuna.visualization.plot_slice(study, params=["x", "y"])
              fig.show()
  
      Args:
          study:
              A :class:`~optuna.study.Study` object whose trials are plotted for their target values.
          params:
              Parameter list to visualize. The default is all parameters.
          target:
              A function to specify the value to display. If it is :obj:`None` and ``study`` is being
              used for single-objective optimization, the objective values are plotted.
  
              .. note::
                  Specify this argument if ``study`` is being used for multi-objective optimization.
          target_name:
              Target's name to display on the axis label.
  
      Returns:
          A :class:`plotly.graph_objs.Figure` object.
      """
  
      _imports.check()
      return _get_slice_plot(
          _get_slice_plot_info(study, params, target, target_name)
      )
  
imports: from __future__ import annotations
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import NamedTuple
  from optuna.distributions import CategoricalChoiceType
  from optuna.distributions import CategoricalDistribution
  from optuna.logging import get_logger
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import _imports
  from optuna.visualization._utils import _check_plot_args
  from optuna.visualization._utils import _filter_nonfinite
  from optuna.visualization._utils import _is_log_scale
label_desc: Use image node_id 3 for calling a global function with example usage: plot_slice(study, params) and returns: _get_slice_plot