Render MATLAB figure in memory
Are there any alternatives to using getframe and saveas for saving the contents of a figure to a raster image for further processing? Approach 1: getframe h = figure('visible', 'off'); a = axes('parent', h); % render using `scatter3()` or other plot function. content = frame2im(getframe(h)); This has the serious drawback of showing the figure to perform a screen capture in the call to getframe() and it is problematic when performing such a render in a loop (i.e. saving content at each iteration as a video frame). Approach 2: saveas h = figure('visible', 'off'); a = axes('parent', h); % render