MATLAB Printing
MATLAB supports the printing of text or graphics.
The default printer, spools via the Unix "lpr" printer system to the HP laserprinter in the ViSAC lab.
Figure print size/scale
MATLAB prints a graphic figure window onto a page using the figure page proporties.
These properties can be set using the figure window menus (File/Page_setup).
Often figure windows are created without menu, thus requireing an alternate method.
The figure page setup can be set using the following MATLAB commands:
-
set( gcf, 'PaperPositionMode', 'manual' );
-
set( gcf, 'PaperType', 'A4' );
- set( gcf, 'PaperUnits', 'centimeters' );
- set( gcf, 'PaperOrientation', 'portrait' );
- set( gcf, 'PaperPosition', [ 1.5 2.5 9.0 12.0 ] );
The above sets the paper type to A4 with dimension for position being given in centimeters.
The figure is positioned, 1.5cm from the left edge, 2.5cm from the
bottom and is scaled to be 9cm wide and 12cm high. The position figures
should be varied to suit the actual figure.
Figure printing workaround.
In some instance, users may find it difficult to set appropriate MATLAB figure print resolutions.
The Unix print spooler/printer are unable to rescale the generated print to fit on the paper.
However it will be possible to obtain a successful print using the following workaround.
- Create a image file of the screen window
- run "xwd -out my_figure.xwd"
- select the figure window with a mouse click
- Open and print the image using Gimp
- gimp my_figure.xwd
|