Break out plot code to separate file