Updated plotting macro and new event count macro
Intermediate commit, may be buggy, use with caution