title: Stop Matlab from resizing the surface when creating an animated gif
body: <p><br>
  I'd like to create a 360 degree rotating surface plot using Matlab2013 (Linux 64bit). I can create an animated gif using code snippet beneath but Matlab keeps resizing the surface at some frames throughout the animation (example see [1], frame 56-59). Any idea how I can prevent Matlab from resizing the plot surface?<br>
  Thanks in advance for your advice.</p>
  
  <pre><code>function createVideo( FigureHandler, filename )
  grid on
  set(gca,'ZTickLabel',[]);
  set(gca,'YTickLabel',[]);
  set(gca,'XTickLabel',[]);
  for n = 1:360
      view(n,66)
      zoom off
      drawnow
      frame = getframe(FigureHandler);
      im = frame2im(frame);
      [imind,cm] = rgb2ind(im,256);
      if n == 1;
          imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
      else
          imwrite(imind,cm,filename,'gif','WriteMode','append','DelayTime',0);
      end
  end
  end
  </code></pre>
  
  <p>[1]
  <a href="http://postimg.org/image/prib1psq5/" rel="nofollow">http://postimg.org/image/prib1psq5/</a></p>