How can I change the default position of the header with 'Print Preview' before printing in MATLAB 7.1(R14SP3)?
1 view (last 30 days)
Show older comments
I am using the File->Print Preview GUI to specify a header for my printout. However, there is no feature to specify the location of my header; it is always placed at the left corner. I want to change this default position to center the header on my printout.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The ability to specify the header position from the File->Print Preview GUI is not available in MATLAB 7.1 (R14SP3).
To work around this issue, you can edit the file 'paperfig.m', which actually places the header during the print operation. Please make a copy of 'paperfig.m' before making changes in order to revert to the original version if needed.
1. Open the file PAPERFIG.M which is located in the directory:
$MATLAB\toolbox\matlab\graphics\private
where $MATLAB is the directory returned by typing 'matlabroot' in the MATLAB command prompt.
2. At line 63, change the value of the 'horizontalalignment' property from
'horizontalalignment','left',...
to
'horizontalalignment','center',...
3. At line 71, change the values of the 'Position' property from
'position',[hs.margin, axpos(4) - hs.margin 0]);
to
'position',[round(axpos(3)/2) axpos(4) - hs.margin 0]); %approximate coordinates for center position
4. Save the file
5. Regenerate the figure and use the File->Print Preview to specify the header text. (NOTE: the new header position will not be updated in the print preview)
6. Print the figure (from the print preview), which will now have the header centered on the page.
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!