ZBUFFER_DATA.m CDATA from hardcopy using zbuffer Get CDATA from hardcopy using zbuffer Need to have PaperPositionMode be auto
0001 function cdata = zbuffer_cdata(hfig) 0002 % ZBUFFER_DATA.m CDATA from hardcopy using zbuffer 0003 % Get CDATA from hardcopy using zbuffer 0004 % 0005 % Need to have PaperPositionMode be auto 0006 orig_mode = get(hfig, 'PaperPositionMode'); 0007 set(hfig, 'PaperPositionMode', 'auto'); 0008 cdata = hardcopy(hfig, '-Dzbuffer', '-r0'); 0009 % Restore figure to original state 0010 set(hfig, 'PaperPositionMode', orig_mode);