title: Error while drawing animation of seaborn heatmap for 3D volume
body: <p>Trying to visualize the <strong>cross-correlation</strong> between two volumes, <a href="https://drive.google.com/file/d/1nMgb7jkaCpgBBLOLGPKNH97v7q0l7s6Y/view?usp=sharing" rel="nofollow noreferrer">img_3D</a>, and <a href="https://drive.google.com/file/d/1JRT3v5PjksYBf_KsD3AAOqvqyygiDbAo/view?usp=sharing" rel="nofollow noreferrer">mask_3D</a>, using <strong>Seaborn heatmap</strong>, and <strong>animation</strong> from Matplotlib to visualize the 3D cross-correlation result as a progressive animation of 2D images, but I was facing an error, can you please tell me how to get rid of this error, and visualize the heatmaps correctly?</p>
  
  <p>Thanks in advance. </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__
      return self.func(*args)
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\_backend_tk.py", line 259, in resize
      self.draw()
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 9, in draw
      super(FigureCanvasTkAgg, self).draw()
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\backend_agg.py", line 392, in draw
      else nullcontext()):
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\contextlib.py", line 112, in __enter__
      return next(self.gen)
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backend_bases.py", line 2788, in _wait_cursor_for_draw_cm
      self.set_cursor(self._lastCursor)
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\_backend_tk.py", line 544, in set_cursor
      window.configure(cursor=cursord[cursor])
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1485, in configure
      return self._configure('configure', cnf, kw)
    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1476, in _configure
      self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
  _tkinter.TclError: invalid command name "."
  </code></pre>
  
  <p>The code used is :</p>
  
  <pre><code># Import Libraries
  #====================================
  import numpy as np
  np.random.seed(0)
  import matplotlib.pyplot as plt
  from matplotlib.animation import FuncAnimation
  import nibabel as nib
  from scipy.signal import correlate
  
  import seaborn as sns
  sns.set()
  #===================================
  
  img = np.load('img.npy')
  act = np.load('act.npy')
  
  # Mode : 'full', 'valid', 'same'
  
  result = correlate(img, act,mode='same')
  
  print(img.shape, act.shape, result.shape)
  
  def updatefig(sl):
      for sl in range(result.shape[2]):
          print(sl,' / ',result.shape[2])
          sns.heatmap(result[...,sl],cbar=False)
          ax.set_title("frame {}".format(sl))
          # Note that using time.sleep does *not* work here!
          plt.pause(0.1)
  fig, ax = plt.subplots()
  
  ani = FuncAnimation(fig, updatefig, frames=range(result.shape[2]), interval=5, blit=True)
  
  plt.show()
  </code></pre>