class_docstr: Granger causality graph.
code: def _plot(self) -> plt.figure:
      alpha_: Callable[[tuple], list] = lambda rgba: list(rgba[:-1]) + [
          0.15
      ]
      edges = []
      edges_h = []
      for y in self.dfp.index:
          s = self.dfp.loc[y].sort_values()
          if s[0] < self.critical:
              n_x, n_y = s.index[0][:-3], y[:-3]
              edges_h.append((self.wrap(n_x), self.wrap(n_y)))
          for x in self.dfp.columns:
              pval = self.dfp.loc[y, x]
              if pval < self.critical:
                  n_x, n_y = x[:-3], y[:-3]
                  edges.append((self.wrap(n_x), self.wrap(n_y), pval))
      weights = sorted([e[2] for e in edges])
      if len(edges) < 1:
          fig = plt.figure(figsize=(0.5, 0.5))
          plt.close(fig)
          return fig
      fig = plt.figure(figsize=self.figsize)
      ax = fig.add_subplot(1, 1, 1)
  
      vmin, vmax = weights[0], weights[-1]
      mapper = mpl.cm.ScalarMappable(
          norm=mpl.colors.Normalize(vmin=vmin, vmax=vmax, clip=True),
          cmap=self.cmap,
      )
  
      g = nx.DiGraph()
      g.add_weighted_edges_from(edges)
      pos = nx.circular_layout(g)
      nx.draw(
          g,
          pos=pos,
          with_labels=True,
          node_color=self.node_color,
          edgecolors=self.edgecolors,
          node_size=4500,
          font_size=8,
          edge_color=[
              alpha_(mapper.to_rgba(e[2]["weight"]))
              for e in g.edges(data=True)
          ],
          width=[
              (self.critical - e[2]["weight"]) * 30
              for e in g.edges(data=True)
          ],
          ax=ax,
      )
      nx.draw_networkx_edges(
          g,
          pos=pos,
          edgelist=edges_h,
          node_size=4500,
          edge_color=self.edge_hi,
          width=1,
          alpha=0.75,
          ax=ax,
      )
      plt.tight_layout()
      plt.close(fig)
      return fig
  
file_path: tslumen/tslumen/plot/static/misc.py
imports: from typing import Tuple, Callable
  import warnings
  from dataclasses import dataclass
  import pandas
  import networkx
  import matplotlib
  import matplotlib.pyplot
  from tslumen.plot.static.base import Figure
label_desc: Use image node_id 1 for calling the GrangerGraph obj's underlying member method code with example usage: obj._plot() and returns: fig, fig