code: def decision_boundaries_univar(
      model,
      x: np.ndarray,
      y: np.ndarray,
      ntiles=100,
      binary_threshold=0.5,
      show=[
          "instances",
          "boundaries",
          "probabilities",
          "misclassified",
          "legend",
      ],
      feature_name=None,
      target_name=None,
      class_names=None,
      markers=None,
      fontsize=9,
      fontname="Arial",
      dot_w=25,
      yshift=0.09,
      sigma=0.09,
      colors: dict = None,
      figsize: Tuple = None,
      ax=None,
  ) -> None:
      """
      See comment and parameter descriptions for decision_boundaries() above.
      """
      if ax is None:
          if figsize:
              fig, ax = plt.subplots(figsize=figsize)
          else:
              fig, ax = plt.subplots()
  
      if isinstance(x, pd.Series):
          x = x.values
      if isinstance(y, pd.Series):
          y = y.values
  
      if (len(x.shape) == 2 and x.shape[1] != 1) or len(x.shape) > 2:
          raise ValueError(f"Expecting 1D data not {x.shape}")
  
      colors = adjust_colors(colors)
  
      mu = 0.08
      class_values = np.unique(y)
      nclasses = len(class_values)
      class_colors = np.array(colors["classes"][nclasses])
      color_map = {
          v: class_colors[i] for i, v in enumerate(class_values)
      }
  
      x1r = np.max(x) - np.min(x)
      x1range = (np.min(x), np.max(x))
      grid_points, w = np.linspace(
          *x1range, num=ntiles, endpoint=True, retstep=True
      )
      grid_proba = _predict_proba(model, grid_points)
      if len(np.unique(y)) == 2:  # is k=2 binary?
          grid_pred = np.where(
              grid_proba[:, 1] >= binary_threshold, 1, 0
          )
      else:
          grid_pred = np.argmax(
              grid_proba, axis=1
          )  # TODO: assumes classes are 0..k-1
      ymax = ax.get_ylim()[1]
  
      # compute the stripes on the bottom showing probabilities
      if "probabilities" in show:
          class_values = np.unique(y)
          (
              color_map,
              grid_pred_colors,
              grid_proba_colors,
          ) = _get_grid_colors(
              grid_proba,
              grid_pred,
              class_values,
              colors=adjust_colors(None),
          )
  
          pred_box_height = 0.08 * ymax
          boxes = []
          for i, gx in enumerate(grid_points):
              rect = patches.Rectangle(
                  (gx, 0),
                  w,
                  pred_box_height,
                  edgecolor="none",
                  facecolor=grid_proba_colors[i],
                  alpha=colors["tile_alpha"],
              )
              boxes.append(rect)
          # drop box around the gradation
          ax.add_collection(PatchCollection(boxes, match_original=True))
          rect = patches.Rectangle(
              (grid_points[0], 0),
              x1r + w,
              pred_box_height,
              linewidth=0.3,
              edgecolor=colors["rect_edge"],
              facecolor="none",
          )
          ax.add_patch(rect)
  
      if "boundaries" in show:
          dx = np.abs(np.diff(grid_pred))
          dx = np.hstack([0, dx])
          dx_edge_idx = np.where(dx)  # indexes of dx class transitions?
          for lx in grid_points[dx_edge_idx]:
              ax.plot(
                  [lx, lx],
                  [*ax.get_ylim()],
                  "--",
                  lw=0.3,
                  c=colors["split_line"],
                  alpha=1.0,
              )
  
      if "instances" in show:
          # user should pass in short and wide fig
          x_proba = _predict_proba(model, x)
          if len(np.unique(y)) == 2:  # is k=2 binary?
              x_pred = np.where(x_proba[:, 1] >= binary_threshold, 1, 0)
          else:
              x_pred = np.argmax(
                  x_proba, axis=1
              )  # TODO: assumes classes are 0..k-1
          class_x = [x[y == cl] for cl in class_values]
          class_x_pred = [x_pred[y == cl] for cl in class_values]
  
          if markers is None:
              markers = ["o"] * len(class_x)
          for (
              i,
              x_,
          ) in enumerate(class_x):
              if "misclassified" in show:
                  # Show correctly classified markers
                  good_x = x_[class_x_pred[i] == class_values[i]]
                  noise = np.random.normal(mu, sigma, size=len(good_x))
                  ax.scatter(
                      good_x,
                      [mu + i * yshift] * len(good_x) + noise,
                      s=dot_w,
                      c=color_map[i],
                      marker=markers[i],
                      alpha=colors["scatter_marker_alpha"],
                      edgecolors=colors["scatter_edge"],
                      lw=0.5,
                  )
                  # Show misclassified markers (can't have alpha per marker so do in 2 calls)
                  bad_x = x_[class_x_pred[i] != class_values[i]]
                  noise = np.random.normal(mu, sigma, size=len(bad_x))
                  ax.scatter(
                      bad_x,
                      [mu + i * yshift] * len(bad_x) + noise,
                      s=dot_w,
                      c=color_map[i],
                      marker=markers[i],
                      alpha=1.0,
                      edgecolors=colors["warning"],
                      lw=0.5,
                  )
              else:
                  noise = np.random.normal(mu, sigma, size=len(x_))
                  ax.scatter(
                      x_,
                      [mu + i * yshift] * len(x_) + noise,
                      s=dot_w,
                      c=color_map[i],
                      marker=markers[i],
                      alpha=colors["scatter_marker_alpha"],
                      edgecolors=colors["scatter_edge"],
                      lw=0.5,
                  )
  
      _format_axes(
          ax,
          feature_name if feature_name is not None else None,
          None,
          colors,
          fontsize,
          fontname,
      )
      ax.spines["left"].set_visible(False)
      ax.set_yticks([])
      ax.set_ylim(0, mu + nclasses * yshift + 6 * sigma)
  
      if "legend" in show:
          class_names = utils._normalize_class_names(
              class_names, nclasses
          )
          add_classifier_legend(
              ax,
              class_names,
              class_values,
              color_map,
              target_name,
              colors,
              fontsize=fontsize,
              fontname=fontname,
          )
  
file_path: dtreeviz/dtreeviz/classifiers.py
imports: from typing import Tuple
  import matplotlib.pyplot
  import numpy
  import pandas
  from PIL import ImageColor
  from colour import Color
  from matplotlib import patches
  from matplotlib.collections import PatchCollection
  from dtreeviz import utils
  from dtreeviz.colors import adjust_colors
  from dtreeviz.utils import add_classifier_legend, _format_axes
label_desc: Use image node_id 7 for calling a global function with example usage: decision_boundaries_univar(model, x, y, ntiles, binary_threshold, show, feature_name, target_name, class_names, markers, fontsize, fontname, dot_w, yshift, sigma, colors, figsize, ax) without return types