add plot code