code: def __decision_plot_matplotlib(
      base_value,
      cumsum,
      ascending,
      feature_display_count,
      features,
      feature_names,
      highlight,
      plot_color,
      axis_color,
      y_demarc_color,
      xlim,
      alpha,
      color_bar,
      auto_size_plot,
      title,
      show,
      legend_labels,
      legend_location,
  ):
      """matplotlib rendering for decision_plot()"""
  
      # image size
      row_height = 0.4
      if auto_size_plot:
          pl.gcf().set_size_inches(
              8, feature_display_count * row_height + 1.5
          )
  
      # draw vertical line indicating center
      pl.axvline(x=base_value, color="#999999", zorder=-1)
  
      # draw horizontal dashed lines for each feature contribution
      for i in range(1, feature_display_count):
          pl.axhline(
              y=i,
              color=y_demarc_color,
              lw=0.5,
              dashes=(1, 5),
              zorder=-1,
          )
  
      # initialize highlighting
      linestyle = np.array("-", dtype=object)
      linestyle = np.repeat(linestyle, cumsum.shape[0])
      linewidth = np.repeat(1, cumsum.shape[0])
      if highlight is not None:
          linestyle[highlight] = "-."
          linewidth[highlight] = 2
  
      # plot each observation's cumulative SHAP values.
      ax = pl.gca()
      ax.set_xlim(xlim)
      m = cm.ScalarMappable(cmap=plot_color)
      m.set_clim(xlim)
      y_pos = np.arange(0, feature_display_count + 1)
      lines = []
      for i in range(cumsum.shape[0]):
          o = pl.plot(
              cumsum[i, :],
              y_pos,
              color=m.to_rgba(cumsum[i, -1], alpha),
              linewidth=linewidth[i],
              linestyle=linestyle[i],
          )
          lines.append(o[0])
  
      # determine font size. if ' *\n' character sequence is found (as in interaction labels), use a smaller
      # font. we don't shrink the font for all interaction plots because if an interaction term is not
      # in the display window there is no need to shrink the font.
      s = next((s for s in feature_names if " *\n" in s), None)
      fontsize = 13 if s is None else 9
  
      # if there is a single observation and feature values are supplied, print them.
      if (cumsum.shape[0] == 1) and (features is not None):
          renderer = pl.gcf().canvas.get_renderer()
          inverter = pl.gca().transData.inverted()
          y_pos = y_pos + 0.5
          for i in range(feature_display_count):
              v = features[0, i]
              if isinstance(v, str):
                  v = f"({str(v).strip()})"
              else:
                  v = "({})".format(f"{v:,.3f}".rstrip("0").rstrip("."))
              t = ax.text(
                  np.max(cumsum[0, i : (i + 2)]),
                  y_pos[i],
                  "  " + v,
                  fontsize=fontsize,
                  horizontalalignment="left",
                  verticalalignment="center_baseline",
                  color="#666666",
              )
              bb = inverter.transform_bbox(
                  t.get_window_extent(renderer=renderer)
              )
              if bb.xmax > xlim[1]:
                  t.set_text(v + "  ")
                  t.set_x(np.min(cumsum[0, i : (i + 2)]))
                  t.set_horizontalalignment("right")
                  bb = inverter.transform_bbox(
                      t.get_window_extent(renderer=renderer)
                  )
                  if bb.xmin < xlim[0]:
                      t.set_text(v)
                      t.set_x(xlim[0])
                      t.set_horizontalalignment("left")
  
      # style axes
      ax.xaxis.set_ticks_position("both")
      ax.yaxis.set_ticks_position("none")
      ax.spines["right"].set_visible(False)
      ax.spines["left"].set_visible(False)
      ax.tick_params(
          color=axis_color, labelcolor=axis_color, labeltop=True
      )
      pl.yticks(
          np.arange(feature_display_count) + 0.5,
          feature_names,
          fontsize=fontsize,
      )
      ax.tick_params("x", labelsize=11)
      pl.ylim(0, feature_display_count)
      pl.xlabel(labels["MODEL_OUTPUT"], fontsize=13)
  
      # draw the color bar - must come after axes styling
      if color_bar:
          m = cm.ScalarMappable(cmap=plot_color)
          m.set_array(np.array([0, 1]))
  
          # place the colorbar
          pl.ylim(0, feature_display_count + 0.25)
          ax_cb = ax.inset_axes(
              [xlim[0], feature_display_count, xlim[1] - xlim[0], 0.25],
              transform=ax.transData,
          )
          cb = pl.colorbar(
              m, ticks=[0, 1], orientation="horizontal", cax=ax_cb
          )
          cb.set_ticklabels([])
          cb.ax.tick_params(labelsize=11, length=0)
          cb.set_alpha(alpha)
          cb.outline.set_visible(False)
  
          # re-activate the main axis for drawing.
          pl.sca(ax)
  
      if title:
          # TODO decide on style/size
          pl.title(title)
  
      if ascending:
          pl.gca().invert_yaxis()
  
      if legend_labels is not None:
          ax.legend(
              handles=lines, labels=legend_labels, loc=legend_location
          )
  
      if show:
          pl.show()
  
file_path: shap/shap/plots/_decision.py
imports: from typing import Union
  import matplotlib.cm
  import matplotlib.pyplot
  import numpy
  import pandas
  from ..utils import hclust_ordering
  from ..utils._legacy import LogitLink, convert_to_link
  from .None import colors
  from ._labels import labels
label_desc: Use image node_id 2 for calling a global function with example usage: __decision_plot_matplotlib(base_value, cumsum, ascending, feature_display_count, features, feature_names, highlight, plot_color, axis_color, y_demarc_color, xlim, alpha, color_bar, auto_size_plot, title, show, legend_labels, legend_location) without return types