I changed to Matlab R2014b and now the code below is not working anymore. With the help of setappdata() I defined a header “This is a test.” on my page. Unfortunately if I do print the figure to a file this header is missing. If I use the "Print Preview…" option within the GUI, the header will be displayed and also printed to the paper. What has changed within Matlab R2014b that this is not working anymore? Your help is much appreciated. BR, Matthias
figure;set(gcf,'PaperType', 'A4'); set(gcf,'PaperOrientation', 'portrait'); set(gcf,'PaperPositionMode','manual') set(gcf,'PaperPosition',[0 1 22 26])hs = getappdata(gcf,'PrintHeaderHeaderSpec');if isempty(hs)hs = struct('dateformat','dd-mmm-yyyy',...'string','',...'fontname','Arial',...'fontsize',12,... % in points'fontweight','bold',...'fontangle','normal',...'margin',72); % in points
endhs.string = 'This is a test.';setappdata(gcf,'PrintHeaderHeaderSpec',hs);print(gcf,'-append','-dpsc','temp.ps');
Best Answer