From: Chiao on 20 Apr 2010 10:22 > Now my question is.. how do you retain the axis & ticks & x,y labels, & title? > Try this: (I modified the getframe line such that you catch the whole picture including the axis) clc;clear all;close all; figure(1); clf; z=imagesc(randn(50,50)); set(gcf, 'Color' ,'w'); % set background to be white f = getframe(figure(1)); % you get the whole picture including the axis [im,map] = rgb2ind(f.cdata,512,'nodither'); for k = 1:20 k imagesc(k*randn(20,20)),title(['B=' num2str(k)]); set(gcf, 'Color' ,'w'); f = getframe(figure(1)); % you get the whole picture including the axis im(:,:,1,k) = rgb2ind(f.cdata,map,'nodither'); pause(1) end imwrite(im,map,'Test.gif','DelayTime',1)
From: Judy on 6 May 2010 21:30 "Chiao " <ctli(a)umich.edu> wrote in message <hqkdac$6pg$1(a)fred.mathworks.com>... > > Now my question is.. how do you retain the axis & ticks & x,y labels, & title? > > > > > Try this: > (I modified the getframe line such that you catch the whole picture including the axis) > > clc;clear all;close all; > figure(1); clf; > z=imagesc(randn(50,50)); > set(gcf, 'Color' ,'w'); % set background to be white > f = getframe(figure(1)); % you get the whole picture including the axis > [im,map] = rgb2ind(f.cdata,512,'nodither'); > > for k = 1:20 > k > imagesc(k*randn(20,20)),title(['B=' num2str(k)]); > set(gcf, 'Color' ,'w'); > f = getframe(figure(1)); % you get the whole picture including the axis > im(:,:,1,k) = rgb2ind(f.cdata,map,'nodither'); > pause(1) > end > imwrite(im,map,'Test.gif','DelayTime',1) Awesome! That would complete what I've been trying to accomplish. I've been getting an error though.. does anyone know what it means? ??? Error using ==> capturescreen The rectangle passed to getframe must be at least partially on screen. Error in ==> getframe at 35 x=capturescreen(varargin{:}); Error in ==> MovieMaker at 5 f = getframe(figure(1)); % you get the whole picture including the axis What does it mean by "must be at least partially on screen". It is on screen.. or is there some sort of lag associated with this? (?? __ ??) <-- confused face Thanks!!!
|
Pages: 1 Prev: Correcting for heteroskedasticity and serial correlation Next: return variables in GUIDE GUI |