docs: def plot_probe(mea, ax=None, xlim=None, ylim=None, color_currents=False, top=None, bottom=None,
                 cmap='viridis', type='shank', alpha_elec=0.7, alpha_prb=0.3):
      '''
      
      Parameters
      ----------
      mea
      axis
      xlim
      ylim
  
      Returns
      -------
  
      '''
  
  
      if ax is None:
          fig = plt.figure()
          ax = fig.add_subplot(111)
  
      n_elec = mea.positions.shape[0]
      elec_size = mea.size
  
      if mea.type == 'mea':
          mea_pos = np.array([np.dot(mea.positions, mea.main_axes[0]), np.dot(mea.positions, mea.main_axes[1])]).T
  
          min_x, max_x = [np.min(np.dot(mea.positions, mea.main_axes[0])),
                          np.max(np.dot(mea.positions, mea.main_axes[0]))]
          center_x = (min_x + max_x)/2.
          min_y, max_y = [np.min(np.dot(mea.positions, mea.main_axes[1])),
                          np.max(np.dot(mea.positions, mea.main_axes[1]))]
          center_y = (min_y + max_y)/2.
  
          if type == 'shank':
              if top is None:
                  probe_height = 200
              else:
                  probe_height = top
              probe_top = max_y + probe_height
              if bottom is None:
                  probe_bottom = min_y - probe_height
              else:
                  probe_bottom = min_y - bottom
              probe_corner = min_y - 0.1*probe_height
              probe_left = min_x - 0.1*probe_height
              probe_right = max_x + 0.1*probe_height
  
              verts = [
                  (min_x - 2*elec_size, probe_top),  # left, bottom
                  (min_x - 2*elec_size, probe_corner),  # left, top
                  (center_x, probe_bottom),  # right, top
                  (max_x + 2*elec_size, probe_corner),  # right, bottom
                  (max_x + 2*elec_size, probe_top),
                  (min_x - 2 * elec_size, max_y + 2 * elec_size) # ignored
              ]
  
              codes = [Path.MOVETO,
                       Path.LINETO,
                       Path.LINETO,
                       Path.LINETO,
                       Path.LINETO,
                       Path.CLOSEPOLY,
                       ]
  
          elif type == 'planar':
              probe_top = max_y + 2 * elec_size
              probe_bottom = min_y - 2 * elec_size
              probe_left = min_x - 2 * elec_size
              probe_right = max_x + 2 * elec_size
  
              verts = [
                  (min_x - 2 * elec_size, max_y + 2 * elec_size),  # left, bottom
                  (min_x - 2 * elec_size, min_y - 2 * elec_size),  # left, top
                  (max_x + 2 * elec_size, min_y - 2 * elec_size),  # right, bottom
                  (max_x + 2 * elec_size, max_y + 2 * elec_size),  # ignored
                  (max_x + 2 * elec_size, max_y + 2 * elec_size)   # ignored
              ]
  
              codes = [Path.MOVETO,
                       Path.LINETO,
                       Path.LINETO,
                       Path.LINETO,
                       Path.CLOSEPOLY,
                       ]
          else:
              raise AttributeError("'type' can be 'shank' or 'planar'")
  
          path = Path(verts, codes)
  
          patch = patches.PathPatch(path, facecolor='green', edgecolor='k', lw=0.5, alpha=alpha_prb)
          ax.add_patch(patch)
  
          if color_currents:
              norm_curr = mea.currents / np.max(np.abs(mea.currents))
              colormap = plt.get_cmap(cmap)
              elec_colors = colormap(norm_curr)
          else:
              elec_colors = ['orange'] * mea.number_electrodes
  
          if mea.shape == 'square':
              for e in range(n_elec):
                  elec = patches.Rectangle((mea_pos[e, 0] - elec_size, mea_pos[e, 1] - elec_size), 2*elec_size,
                                           2*elec_size, alpha=alpha_elec, facecolor=elec_colors[e],
                                           edgecolor=[0.3, 0.3, 0.3], lw=0.5)
  
                  ax.add_patch(elec)
          elif mea.shape == 'circle':
              for e in range(n_elec):
                  elec = patches.Circle((mea_pos[e, 0], mea_pos[e, 1]), elec_size, alpha=alpha_elec,
                                        facecolor=elec_colors[e], edgecolor=[0.3, 0.3, 0.3], lw=0.5)
  
                  ax.add_patch(elec)
      else:
          raise NotImplementedError('Wire type plotting not implemented')
  
      ax.axis('equal')
  
      if xlim:
          ax.set_xlim(xlim)
      else:
          ax.set_xlim(probe_left - 5 * elec_size, probe_right + 5 * elec_size)
      if ylim:
          ax.set_ylim(ylim)
      else:
          ax.set_ylim(probe_bottom - 5 * elec_size, probe_top + 5 * elec_size)
  
      return ax