code: def plot_result(filt, full, prntres=True):
      r
      if not plt:
          print(plt_msg)
          return
      if prntres:
          print_result(filt, full)
      spacing = full[2][0, :, 0]
      shift = full[2][1, 0, :]
      minfield = np.squeeze(full[3])
      plt.figure("Brute force result", figsize=(9.5, 4.5))
      plt.subplots_adjust(wspace=.4, bottom=0.2)
      if spacing.size > 1 or shift.size > 1:
          plt.subplot(121)
          if full[4] == 0:
              plt.title("Minimal recovered fields")
              ylabel = 'Minimal recovered amplitude (log10)'
              field = np.log10(minfield)
              cmap = plt.cm.viridis
          else:
              plt.title("Maximum recovered r")
              ylabel = 'Maximum recovered r'
              field = 1/minfield
              cmap = plt.cm.viridis_r
          if shift.size == 1:
              plt.plot(spacing, field)
              plt.xlabel('Spacing')
              plt.ylabel(ylabel)
          elif spacing.size == 1:
              plt.plot(shift, field)
              plt.xlabel('Shift')
              plt.ylabel(ylabel)
          else:
              field = np.ma.masked_where(np.isinf(minfield), field)
              plt.pcolormesh(shift, spacing, field, cmap=cmap)
              plt.ylabel('Spacing')
              plt.xlabel('Shift')
              plt.colorbar()
      if spacing.size > 1 or shift.size > 1:
          plt.subplot(122)
      plt.title('Filter values of best filter')
      for attr in ['j0', 'j1', 'sin', 'cos']:
          if hasattr(filt, attr):
              plt.plot(np.log10(filt.base),
                       np.log10(np.abs(getattr(filt, attr))), '.-', lw=.5,
                       label='abs('+attr+')')
              plt.plot(np.log10(filt.base), np.log10(-getattr(filt, attr)), '.',
                       color='k', ms=4)
      plt.plot(np.inf, 0, '.', color='k', ms=4, label='Neg. values')
      plt.xlabel('Base (log10)')
      plt.ylabel('Abs(Amplitude) (log10)')
      plt.legend(loc='best')
      plt.gcf().canvas.draw()
      plt.show()