MATLAB: VideoWriter clipping the axes

getframevideowriterwritevideo

I'm using the VideoWriter feature for a simple animation of motion of a 3-D surface. Running through the loop, I can see in my figure window that the plot looks great, but something in the process is removing several dozen pixels bounding the entire figure. The result is that I only see a small corner of the axes. Is getframe trimming away my edges? How can I fix it?

Best Answer

I figured out the fix:
getframe(gcf,[left bottom width height]),
using the figure position from get(gcf).