fixing plotting macro