docs: def view_similarity_matrix(self, data=None, labels=None, figsize=None,
                                 filename=None):
          """Plot the similarity map according to the activation map
  
          :param data: Optional parameter for data points to calculate the
                       similarity with
          :type data: numpy.array
          :param figsize: Optional parameter to specify the size of the figure.
          :type figsize: (int, int)
          :param labels: Optional parameter to specify the label of each point.
          :type labels: list of str.
          :param filename: If specified, the plot will not be shown but saved to
                           this file.
          :type filename: str.
          """
  
          if not have_heatmap:
              raise Exception("Import dependencies missing for viewing "
                              "similarity matrix. You must have seaborn and "
                              "scikit-learn")
          if data is None and self.activation_map is None:
              self.get_surface_state()
          if data is None:
              X = self.activation_map
          else:
              X = data
          # Calculate the pairwise correlations as a metric for similarity
          corrmat = 1 - pairwise_distances(X, metric="correlation")
  
          # Set up the matplotlib figure
          if figsize is None:
              figsize = (12, 9)
          f, ax = plt.subplots(figsize=figsize)
  
          # Y axis has inverted labels (seaborn default, no idea why)
          if labels is None:
              xticklabels = []
              yticklabels = []
          else:
              xticklabels = labels
              yticklabels = labels
  
          # Draw the heatmap using seaborn
          sns.heatmap(corrmat, vmax=1, vmin=-1, square=True,
                      xticklabels=xticklabels, yticklabels=yticklabels,
                      cmap="RdBu_r", center=0)
          f.tight_layout()
  
          # This sets the ticks to a readable angle
          plt.yticks(rotation=0)
          plt.xticks(rotation=90)
  
          # This sets the labels for the two axes
          ax.set_yticklabels(yticklabels, ha='right', va='center', size=8)
          ax.set_xticklabels(xticklabels, ha='center', va='top', size=8)
  
          # Save and close the figure
          if filename is not None:
              plt.savefig(filename, bbox_inches='tight')
          else:
              plt.show()
          return plt