Write out 2D: Error using plot