Stop Matlab from resizing surfaces while creating an animated gif


I would like to create a 360-degree rotating surface using Matlab2013 (Linux 64 bit). I can create an animated gif using the code snippet below, but Matlab continues to resize the surface in some frames during the animation (for an example, see [1], frame 56-59). Any idea how I can prevent Matlab from resizing the surface?
Thanks in advance for your advice.

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

[1] http://postimg.org/image/prib1psq5/

+4
source share
1 answer

, , 'XLimMode', 'YLimMode' 'ZLimMode', 'manual'.

(, DataAspectRatio, PlotBoxAspectRatio ..)

Matlab vis3d, !
, :

axis('vis3d')

.., for

+3

Source: https://habr.com/ru/post/1544450/


All Articles