Problem using 'getframe' and 'movie' with larger data sets

3 views (last 30 days)
When I use the following code and I have 'data_size' set to 10 it works fine. That is I can use 'movie' to replay the frames caputered using 'getframe' without a problem. However when I increase the value of 'data_size' to 100 I run in to a problem. When I use 'movie' on the captured frames I get a blank (black) figure!
I have tried all sorts of things, including going back to a single monitor, and explicitly specifying the 'position' of the figure used by 'getframe' and 'movie'. Any suggestions as to what is happening here?
data_size = 10;
figure1 = figure; hold off;
u = repmat([1:1:10]',data_size,10); v = u*2;
for qq = 1:10 subplot1 = subplot(1,2,1,'Parent',figure1); surf(u(qq:qq+data_size,:),'Parent',subplot1,'LineStyle','none'); subplot2 = subplot(1,2,2,'Parent',figure1); surf(v(qq:qq+data_size,:),'Parent',subplot2,'LineStyle','none'); mymovie(qq) = getframe(figure1);
end

Accepted Answer

Jan
Jan on 7 Mar 2013
Edited: Jan on 7 Mar 2013
Try to insert a drawnow before getframe().
Another idea: Set the renderer to Painters or ZBuffer, because the OpenGL renderer can have many different problems. If this helps, but you want the OpenGL renderer, update the graphic drives and try:
opengl software
  1 Comment
Chris
Chris on 8 Mar 2013
Give the man a cigar. The 'Drawnow' suggestion didn't work, but the Renderer suggestion did. I put the following commands in after the 'figure1= figure' command.
set(figure1,'RendererMode','manual','Renderer','zbuffer')
I also tried using the 'painters' option, but it is quite a bit slower.
Thanks again Jan, you saved me many hours.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!