working version of single canvas plotting macro