code: def _add_rank_subplot(
      ax: "Axes",
      info: _RankSubplotInfo,
      set_x_label: bool = True,
      set_y_label: bool = True,
  ) -> "PathCollection":
      if set_x_label:
          ax.set_xlabel(info.xaxis.name)
      if set_y_label:
          ax.set_ylabel(info.yaxis.name)
  
      if not info.xaxis.is_cat:
          ax.set_xlim(info.xaxis.range[0], info.xaxis.range[1])
      if not info.yaxis.is_cat:
          ax.set_ylim(info.yaxis.range[0], info.yaxis.range[1])
  
      if info.xaxis.is_log:
          ax.set_xscale("log")
  
      if info.yaxis.is_log:
          ax.set_yscale("log")
  
      return ax.scatter(
          x=info.xs, y=info.ys, c=info.colors / 255, edgecolors="grey"
      )
  
file_path: optuna/optuna/visualization/matplotlib/_rank.py
imports: from __future__ import annotations
  from typing import Callable
  from optuna._experimental import experimental_func
  from optuna.logging import get_logger
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.visualization._rank import _get_rank_info
  from optuna.visualization._rank import _get_tick_info
  from optuna.visualization._rank import _RankPlotInfo
  from optuna.visualization._rank import _RankSubplotInfo
  from optuna.visualization.matplotlib._matplotlib_imports import _imports
label_desc: Use image node_id 3 for calling a global function with example usage: _add_rank_subplot(ax, info, set_x_label, set_y_label) and returns: ax