class_docstr: Scatter matrix (aka pair plot) with scatters, KDE and correlation Heatmap.
class_docstr_tok: ["Scatter","matrix","(","aka","pair","plot",")","with","scatters",",","KDE","and","correlation","Heatmap","."]
code: def _plot(self) -> plt.figure:
      ncols = self.df.shape[1]
      figsize = max(
          self.min_figsize,
          (self.figsize[0] * ncols, self.figsize[1] * ncols),
      )
      fig = plt.figure(figsize=figsize)
      layout = (ncols, ncols)
      minima = -1.0
      maxima = 1.0
      thresh = 0.0
  
      norm = mpl.colors.Normalize(vmin=minima, vmax=maxima, clip=True)
      mapper = mpl.cm.ScalarMappable(norm=norm, cmap="PuBu")
  
      for i, a in enumerate(self.df.columns):
          for j, b in enumerate(self.df.columns):
              ax = plt.subplot2grid(layout, (i, j))
              ax.xaxis.set_visible(False)
              ax.yaxis.set_visible(False)
              corr = self.df_corr.loc[a, b]
              color = mapper.to_rgba(corr)
              acolor = "black" if corr < thresh else "white"
              xcolor = (
                  mapper.to_rgba(0.7)
                  if corr < thresh
                  else mapper.to_rgba(0)
              )
              if i > j:
                  ax.plot(
                      self.df[b],
                      self.df[a],
                      marker="o",
                      color=color,
                      markersize=2,
                      linestyle="None",
                      alpha=0.5,
                      markeredgewidth=0.1,
                      markeredgecolor=xcolor,
                  )
              elif i < j:
                  ax.set_facecolor(color)
                  ax.text(
                      0.5,
                      0.5,
                      f"{corr:.3f}",
                      color=acolor,
                      fontsize=8,
                      transform=ax.transAxes,
                      horizontalalignment="center",
                      verticalalignment="center",
                  )
  
      for i, a in enumerate(self.df.columns):
          ax = plt.subplot2grid(layout, (i, i))
          ax.xaxis.set_visible(False)
          ax.yaxis.set_visible(False)
          kde = gaussian_kde(self.df[a].dropna())
          sp = np.linspace(
              self.df[a].dropna().min(), self.df[a].dropna().max(), 1000
          )
          ax.plot(
              sp,
              kde.evaluate(sp),
              color=self.PALETTE[0],
              linewidth=0.75,
          )
          ax.text(
              0.5,
              0.5,
              a,
              fontsize=8,
              transform=ax.transAxes,
              horizontalalignment="center",
              verticalalignment="center",
              rotation=45,
              bbox=dict(facecolor="white", alpha=0.7, linewidth=0),
          )
  
      with warnings.catch_warnings():
          warnings.filterwarnings("ignore", category=UserWarning)
          plt.tight_layout()
      fig.subplots_adjust(wspace=0, hspace=0)
      plt.close(fig)
      return fig
  
file_path: tslumen/tslumen/plot/static/correlation.py
imports: from typing import Tuple, Optional
  import warnings
  from dataclasses import dataclass
  import numpy
  import pandas
  from scipy.stats import gaussian_kde
  import matplotlib
  import matplotlib.pyplot
  from tslumen.plot.static.base import Figure
label_desc: Use image node_id 1 for calling the ScatterMatrix obj's underlying member method code with example usage: obj._plot() and returns: fig