massive speed increase for exportPlot by vectorizing