\documentclass[12pt]{article}

\usepackage{gamelan}
\usepackage{amsmath}

\begin{document}
\begin{gmlfile}

\begin{gmlcode}
  color col.default, col.excess;
  col.default = 0.9white;
  col.excess  = red;
  boolean show_excess;
  show_excess = false;
\end{gmlcode}

\section{Cascade Decays}
$p + p \to u+ \bar u \to \bar{\tilde u}_1 + u + \tilde e_{12}^+ + e^-$

\vspace*{\baselineskip}
\vspace*{\baselineskip}
\unitlength 1mm
\begin{gmlgraph*}(130,90)[dat]
  setup (linear,linear); 
  graphrange (#0.00, #0), (#600., ??);
  fromfile "casc_dec.dat":
    key "# Histogram:";
    dx := #10.0;
    for i withinblock:
      get x, y, y.d, n, y.e;
      plot (data) (x,y) hbar dx;
    endfor
    key "# Histogram:";
    dx := #10.0;
    for i withinblock:
      get x, y, y.d, n, y.e;
      plot (datb) (x,y) hbar dx;
    endfor
    key "# Histogram:";
    dx := #10.0;
    for i withinblock:
      get x, y, y.d, n, y.e;
      plot (datc) (x,y) hbar dx;
    endfor
    key "# Histogram:";
    dx := #10.0;
    for i withinblock:
      get x, y, y.d, n, y.e;
      plot (datd) (x,y) hbar dx;
    endfor
  endfrom
  calculate data.base (datb) (x,#0);
  calculate datb.base (datb) (x,#0);
  calculate datc.base (datc) (x,#0);
  calculate datd.base (datd) (x,#0);
  pickup pencircle scaled 2pt;
  draw piecewise cyclic from (datd, datd.base/\) withcolor blue withlegend  btex isotropic etex;
  draw piecewise cyclic from (datc, datc.base/\) withcolor green withlegend btex diag. etex;
  draw piecewise cyclic from (datb, datb.base/\) withcolor red withlegend  btex off-diag. etex;
  draw piecewise cyclic from (data, data.base/\) withcolor black withlegend btex full etex;
  label.ulft (<<\#evt/bin>>, out);
  label.bot (<<$M_{\rm inv}(ue^-)$>>, out);
  begingroup interim bboxmargin:=3mm;
    label.urt(fdbox(thelegend) (withcolor white) ()(), on graph at (#410,#700));
  endgroup;
\end{gmlgraph*}
\end{gmlfile}
\end{document}
