plot stuff on same figure in fullscreen mode
9 ビュー (過去 30 日間)
古いコメントを表示
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; "
0 件のコメント
採用された回答
Image Analyst
2012 年 2 月 1 日
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.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!