class_docstr: SmartPlotter is a Bridge pattern decoupling plotting functions from SmartExplainer.
  The smartplotter class includes all the methods used to display graphics
  Each SmartPlotter method is easy to use from a Smart explainer object,
  just use the following syntax
  Attributes :
  explainer: object
      SmartExplainer instance to point to.
  Example
  --------
  >>> xpl.plot.my_plot_method(param=value)
class_docstr_tok: ["SmartPlotter","is","a","Bridge","pattern","decoupling","plotting","functions","from","SmartExplainer",".","The","smartplotter","class","includes","all","the","methods","used","to","display","graphics","Each","SmartPlotter","method","is","easy","to","use","from","a","Smart","explainer","object",",","just","use","the","following","syntax","Attributes",":","explainer",":","object","SmartExplainer","instance","to","point","to",".","Example","--","--","--","--",">",">",">","xpl.plot.my_plot_method","(","param=value",")"]
docstr: Function used by both violin and scatter methods for contributions plots in order to
  update the layout of the (already) created plotly figure.
  Parameters
  ----------
  fig : go.Figure
      Plotly figure to be modified.
  feature_name : String
      Name of the feature, used in title
  pred: 1 column pd.DataFrame (optional)
      predicted values used to color plot - One Vs All in multiclass case
  proba_values: 1 column pd.DataFrame (optional)
      predicted proba used to color points - One Vs All in multiclass case
  col_modality: Int, Float or String (optional)
      parameter used in classification case,
      specify the modality to color in scatter plot (One Vs All)
  col_scale: list (optional)
      specify the color of points in scatter data
  addnote : String (default: None)
      Specify a note to display
  subtitle : String (default: None)
      Subtitle to display
  width : Int (default: 900)
      Plotly figure - layout width
  height : Int (default: 600)
      Plotly figure - layout height
  file_name: string (optional)
      Specify the save path of html files. If it is not provided, no file will be saved.
  auto_open: bool (default=False)
      open automatically the plot
code: def _update_contributions_fig(
      self,
      fig,
      feature_name,
      pred,
      proba_values,
      col_modality,
      col_scale,
      addnote,
      subtitle,
      width,
      height,
      file_name,
      auto_open,
  ):
      """
      Function used by both violin and scatter methods for contributions plots in order to
      update the layout of the (already) created plotly figure.
      Parameters
      ----------
      fig : go.Figure
          Plotly figure to be modified.
      feature_name : String
          Name of the feature, used in title
      pred: 1 column pd.DataFrame (optional)
          predicted values used to color plot - One Vs All in multiclass case
      proba_values: 1 column pd.DataFrame (optional)
          predicted proba used to color points - One Vs All in multiclass case
      col_modality: Int, Float or String (optional)
          parameter used in classification case,
          specify the modality to color in scatter plot (One Vs All)
      col_scale: list (optional)
          specify the color of points in scatter data
      addnote : String (default: None)
          Specify a note to display
      subtitle : String (default: None)
          Subtitle to display
      width : Int (default: 900)
          Plotly figure - layout width
      height : Int (default: 600)
          Plotly figure - layout height
      file_name: string (optional)
          Specify the save path of html files. If it is not provided, no file will be saved.
      auto_open: bool (default=False)
          open automatically the plot
      """
      title = (
          f"<b>{truncate_str(feature_name)}</b> - Feature Contribution"
      )
      # Add subtitle and / or addnote
      if subtitle or addnote:
          # title += f"<span style='font-size: 12px;'><br />{add_text([subtitle, addnote], sep=' - ')}</span>"
          if subtitle and addnote:
              title += (
                  "<br><sup>" + subtitle + " - " + addnote + "</sup>"
              )
          elif subtitle:
              title += "<br><sup>" + subtitle + "</sup>"
          else:
              title += "<br><sup>" + addnote + "</sup>"
      dict_t = copy.deepcopy(self._style_dict["dict_title"])
      dict_xaxis = copy.deepcopy(self._style_dict["dict_xaxis"])
      dict_yaxis = copy.deepcopy(self._style_dict["dict_yaxis"])
      dict_t["text"] = title
      dict_xaxis["text"] = truncate_str(feature_name, 110)
      dict_yaxis["text"] = "Contribution"
  
      if self.explainer._case == "regression":
          colorpoints = pred
          colorbar_title = "Predicted"
      elif self.explainer._case == "classification":
          colorpoints = proba_values
          colorbar_title = "Predicted Proba"
  
      if colorpoints is not None:
          fig.data[-1].marker.color = colorpoints.values.flatten()
          fig.data[-1].marker.coloraxis = "coloraxis"
          fig.layout.coloraxis.colorscale = col_scale
          fig.layout.coloraxis.colorbar = {
              "title": {"text": colorbar_title}
          }
  
      elif fig.data[0].type != "violin":
          if (
              self.explainer._case == "classification"
              and pred is not None
          ):
              fig.data[-1].marker.color = pred.iloc[:, 0].apply(
                  lambda x: self._style_dict["violin_area_classif"][1]
                  if x == col_modality
                  else self._style_dict["violin_area_classif"][0]
              )
          else:
              fig.data[-1].marker.color = self._style_dict[
                  "violin_default"
              ]
  
      fig.update_traces(
          marker={
              "size": 10,
              "opacity": 0.8,
              "line": {"width": 0.8, "color": "white"},
          }
      )
  
      fig.update_layout(
          template="none",
          title=dict_t,
          width=width,
          height=height,
          xaxis_title=dict_xaxis,
          yaxis_title=dict_yaxis,
          hovermode="closest",
      )
  
      fig.update_yaxes(automargin=True)
      fig.update_xaxes(automargin=True)
      if file_name:
          plot(fig, filename=file_name, auto_open=auto_open)
  
imports: import warnings
  from numbers import Number
  import random
  import copy
  import math
  import numpy
  from scipy.optimize import fsolve
  import scipy.cluster.hierarchy
  import pandas
  from plotly import graph_objs
  import plotly.express
  from plotly.subplots import make_subplots
  from plotly.offline import plot
  from shapash.manipulation.select_lines import select_lines
  from shapash.manipulation.summarize import compute_features_import, project_feature_values_1d, compute_corr
  from shapash.utils.utils import add_line_break, truncate_str, compute_digit_number, add_text, maximum_difference_sort_value, compute_sorted_variables_interactions_list_indices, compute_top_correlations_features
  from shapash.webapp.utils.utils import round_to_k
  from shapash.style.style_utils import colors_loading, select_palette, define_style
label_desc: Use image node_id 5 for calling the SmartPlotter obj's underlying member method code with example usage: obj._update_contributions_fig(fig, feature_name, pred, proba_values, col_modality, col_scale, addnote, subtitle, width, height, file_name, auto_open) without return types