From 0d5cb9a7e042dd30b8ba8c0e84c2cda7643ff254 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Tue, 4 Sep 2012 05:13:35 +0000 Subject: [PATCH] fix figure update bug in VisualISAMPlot when run with "Save Figures" enabled. --- matlab/+gtsam/VisualISAMPlot.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/matlab/+gtsam/VisualISAMPlot.m b/matlab/+gtsam/VisualISAMPlot.m index 5ef64cf62..cd7ab188e 100644 --- a/matlab/+gtsam/VisualISAMPlot.m +++ b/matlab/+gtsam/VisualISAMPlot.m @@ -39,11 +39,12 @@ drawnow %% do various optional things if options.saveFigures - fig2 = figure('visible','off'); - newax = copyobj(h,fig2); - colormap(fig2,'hot'); + figToSave = figure('visible','off'); + newax = copyobj(h,figToSave); + colormap(figToSave,'hot'); set(newax, 'units', 'normalized', 'position', [0.13 0.11 0.775 0.815]); - print(fig2,'-dpng',sprintf('VisualiSAM%03d.png',M)); + print(figToSave,'-dpng',sprintf('VisualiSAM%03d.png',M)); + axes(h); end if options.saveDotFiles