Added event detection.
Mark events in plot.