Error when plotting "error creating stream for file"