def triple_plot(cccsum, cccsum_hist, trace, threshold, **kwargs):
import matplotlib.pyplot as plt<EOL>if len(cccsum) != len(trace.data):<EOL><INDENT>print('<STR_LIT>' +<EOL>str(len(cccsum)) + '<STR_LIT>' + str(len(trace.data)))<EOL>msg = '<STR_LIT:U+0020>'.join(['<STR_LIT>',<EOL>'<STR_LIT>'])<EOL>raise ValueError(msg)<EOL><DEDENT>df = trace.stats.sampling_rate<EOL>npts = trace.stats.npts<EOL>t = np.arange(npts, dtype=np.float32) / (df * <NUM_LIT>)<EOL>ax1 = plt.subplot2grid((<NUM_LIT:2>, <NUM_LIT:5>), (<NUM_LIT:0>, <NUM_LIT:0>), colspan=<NUM_LIT:4>)<EOL>ax1.plot(t, trace.data, '<STR_LIT:k>')<EOL>ax1.axis('<STR_LIT>')<EOL>ax1.set_ylim([-<NUM_LIT:15> * np.mean(np.abs(trace.data)),<EOL><NUM_LIT:15> * np.mean(np.abs(trace.data))])<EOL>ax2 = plt.subplot2grid((<NUM_LIT:2>, <NUM_LIT:5>), (<NUM_LIT:1>, <NUM_LIT:0>), colspan=<NUM_LIT:4>, sharex=ax1)<EOL>ax2.plot([min(t), max(t)], [threshold, threshold], color='<STR_LIT:r>', lw=<NUM_LIT:1>,<EOL>label="<STR_LIT>")<EOL>ax2.plot([min(t), max(t)], [-threshold, -threshold], color='<STR_LIT:r>', lw=<NUM_LIT:1>)<EOL>ax2.plot(t, cccsum, '<STR_LIT:k>')<EOL>ax2.axis('<STR_LIT>')<EOL>ax2.set_ylim([-<NUM_LIT> * threshold, <NUM_LIT> * threshold])<EOL>ax2.set_xlabel("<STR_LIT>" % trace.stats.starttime.isoformat())<EOL>ax3 = plt.subplot2grid((<NUM_LIT:2>, <NUM_LIT:5>), (<NUM_LIT:1>, <NUM_LIT:4>), sharey=ax2)<EOL>ax3.hist(cccsum_hist, <NUM_LIT:200>, normed=<NUM_LIT:1>, histtype='<STR_LIT>',<EOL>orientation='<STR_LIT>', color='<STR_LIT>')<EOL>ax3.set_ylim([-<NUM_LIT:5>, <NUM_LIT:5>])<EOL>fig = plt.gcf()<EOL>fig.suptitle(trace.id)<EOL>fig.canvas.draw()<EOL>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>return fig<EOL>
Plot a seismogram, correlogram and histogram.

:type cccsum: numpy.ndarray
:param cccsum: Array of the cross-channel cross-correlation sum
:type cccsum_hist: numpy.ndarray
:param cccsum_hist: cccsum for histogram plotting, can be the same as \
    cccsum but included if cccsum is just an envelope.
:type trace: obspy.core.trace.Trace
:param trace: A sample trace from the same time as cccsum
:type threshold: float
:param threshold: Detection threshold within cccsum
:type save: bool
:param save: If True will save and not plot to screen, vice-versa if False
:type savefile: str
:param savefile: Path to save figure to, only required if save=True

:returns: :class:`matplotlib.figure.Figure`

.. rubric:: Example

>>> from obspy import read
>>> from eqcorrscan.core.match_filter import normxcorr2
>>> from eqcorrscan.utils.plotting import triple_plot
>>> st = read()
>>> template = st[0].copy().trim(st[0].stats.starttime + 8,
...                            st[0].stats.starttime + 12)
>>> tr = st[0]
>>> ccc = normxcorr2(template=template.data, image=tr.data)
>>> tr.data = tr.data[0:len(ccc[0])]
>>> triple_plot(cccsum=ccc[0], cccsum_hist=ccc[0], trace=tr,
...             threshold=0.8) # doctest: +SKIP


.. image:: ../../plots/triple_plot.png