How can I programatically set the page header for printing a figure in MATLAB 7.0 (R14)?
4 次查看(过去 30 天)
显示 更早的评论
I would like to know how to programatically set the page header for printing a figure in MATLAB 7.0 (R14).
采纳的回答
MathWorks Support Team
2009-6-27
1. Create a figure by executing the following command:
plot(1:10)
2. The page header of the current figure can be set by executing the following commands:
hs = getappdata(gcf,'PrintHeaderHeaderSpec');
if isempty(hs)
hs = struct('dateformat','none',...
'string','',...
'fontname','Times',...
'fontsize',12,... % in points
'fontweight','normal',...
'fontangle','normal',...
'margin',72); % in points
end
currentPage = 1;
totalPages = 10;
hs.string = ['Header: Page ' num2str(currentPage) ' of ' num2str(totalPages)];
setappdata(gcf,'PrintHeaderHeaderSpec',hs);
3. The header will be visible when the figure is printed or previewed by selecting "File -> Print Preview".
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!