The second and each following frame of video must be the same size as the first frame that is written.
Each time you draw a new plot, there is the possibility that getframe() of it might be a slightly different size, even if the figure size and axes size remains exactly the same.
In particular, the algorithm for automatically labeling axes has a little bit of slop for the position of the rightmost characters. Because of that, the captured axes width can be up to 2 pixels shorter than normal, or up to 5 pixels wider than usual.
One typical work-around is to imresize() the second and following captured frames to be the same size as the first captured frame.
