code: def _match_filter_plot(stream, cccsum, template_names, rawthresh, plotdir,
                         plot_format, i):  # pragma: no cover
      
      import matplotlib.pyplot as plt
      plt.ioff()
      stream_plot = copy.deepcopy(stream[0])
      # Downsample for plotting
      stream_plot = _plotting_decimation(stream_plot, 10e5, 4)
      cccsum_plot = Trace(cccsum)
      cccsum_plot.stats.sampling_rate = stream[0].stats.sampling_rate
      # Resample here to maintain shape better
      cccsum_hist = cccsum_plot.copy()
      cccsum_hist = cccsum_hist.decimate(int(stream[0].stats.
                                             sampling_rate / 10)).data
      cccsum_plot = chunk_data(cccsum_plot, 10, 'Maxabs').data
      # Enforce same length
      stream_plot.data = stream_plot.data[0:len(cccsum_plot)]
      cccsum_plot = cccsum_plot[0:len(stream_plot.data)]
      cccsum_hist = cccsum_hist[0:len(stream_plot.data)]
      plot_name = (plotdir + os.sep + 'cccsum_plot_' + template_names[i] + '_' +
                   stream[0].stats.starttime.datetime.strftime('%Y-%m-%d') +
                   '.' + plot_format)
      triple_plot(cccsum=cccsum_plot, cccsum_hist=cccsum_hist,
                  trace=stream_plot, threshold=rawthresh, save=True,
                  savefile=plot_name)
docs: Plotting function for match_filter.
  
      :param stream: Stream to plot
      :param cccsum: Cross-correlation sum to plot
      :param template_names: Template names used
      :param rawthresh: Threshold level
      :param plotdir: Location to save plots
      :param plot_format: Output plot type (e.g. png, svg, eps, pdf...)
      :param i: Template index name to plot.