plot stuff on same figure in fullscreen mode

1 visualización (últimos 30 días)
Saad
Saad el 1 de Feb. de 2012
Hi, I am trying to plot some stuff on a figure, and then saving it in a video (figure has to be in fullscreen mode otherwise some stuff in video won't be clearly visible). The problem is that I have to close the figure after getting each frame, otherwise it keep plotting stuff on new figures. I have tried using "figure(1)" but when i provide it the position "figure(1,'Position',[0 0 fullscreen(3) fullscreen(4)])" it gives an error.
my current code is " fullscreen = get(0,'ScreenSize'); h = figure('Position',[0 0 fullscreen(3) fullscreen(4)]);hold on %% I Plot some stuff here on the figure already created currFrame = getframe(h); writeVideo(videoObj,currFrame); close all; "

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Feb. de 2012
Well don't call figure each time. That's what's creating the new figures. Call set() instead, like this:
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]); % Maximize figure.
% Give a name to the title bar.
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')
If you have h in advance because you created the figure before your loop starts (which you should do), you can use h instead of gcf.

Más respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by