code: def plot_kde(self,
                   ax=None,
                   amax=None,
                   amin=None,
                   label=None,
                   return_fig=False):
          
          from scipy.stats import gaussian_kde
  
          if ax is None:
              fig = plt.figure()
              ax = fig.add_subplot(111)
              return_ax = False
          else:
              return_ax = True
  
          a = self[~np.isnan(self)]
  
          # Find values for common axis to exclude outliers.
          if amax is None:
              amax = np.percentile(a, 99)
          if amin is None:
              amin = np.percentile(a,  1)
  
          x = a[np.abs(a - 0.5 * (amax + amin)) < 0.5 * (amax - amin)]
          x_grid = np.linspace(amin, amax, 100)
  
          kde = gaussian_kde(x)
          std_a = kde.evaluate(x_grid)
  
          img = np.array([std_a]) / np.max([std_a])
          extent = [amin, amax, 0, 1]
          ax.imshow(img, aspect='auto', cmap='viridis', extent=extent)
          ax.set_yticklabels([])
          ax.set_ylabel(label or self.mnemonic)
  
          if return_ax:
              return ax
          elif return_fig:
              return fig
          else:
              return None
docs: Plot a KDE for the curve. Very nice summary of KDEs:
          https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/
  
          Args:
              ax (axis): Optional matplotlib (MPL) axis to plot into. Returned.
              amax (float): Optional max value to permit.
              amin (float): Optional min value to permit.
              label (string): What to put on the y-axis. Defaults to curve name.
              return_fig (bool): If you want to return the MPL figure object.
  
          Returns:
              None, axis, figure: depending on what you ask for.