Add some counters and flags to the plotting macro