Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing a MATLAB plot in exact dimensions on paper

I have a plot that needs to be printed out in exact dimensions on paper, since it is in scale and from it on paper some things will be measured. What would be the easiest (is it possible at all) way to do it?

like image 897
Rook Avatar asked Aug 30 '10 13:08

Rook


People also ask

How do you print a plot in Matlab?

To print a figure, use File > Print. For example, create a bar chart to print. Click File > Print, select a printer, and click OK. The printer must be set up on your system.

How do I fix the size of a figure in Matlab?

To maximize the figure window in Windows, you can use the attached function. Otherwise you can also use code like this, to take up most of the screen except for the task bar at the bottom. % Enlarge figure to full screen. set(gcf, 'Units', 'Normalized', 'OuterPosition', [0, 0.04, 1, 0.96]);


1 Answers

EDIT:

%# create some plot, and make axis fill entire figure
plot([0 5 0 5], [0 10 10 0]), axis tight
set(gca, 'Position',[0 0 1 1])

%# set size of figure's "drawing" area on screen
set(gcf, 'Units','centimeters', 'Position',[0 0 5 10])

%# set size on printed paper
%#set(gcf, 'PaperUnits','centimeters', 'PaperPosition',[0 0 5 10])
%# WYSIWYG mode: you need to adjust your screen's DPI (*)
set(gcf, 'PaperPositionMode','auto')

%# save as TIFF
print -dtiff -r0 out.tiff

(*): http://www.mathworks.com/help/matlab/creating_plots/printing-images.html

screenshot

like image 94
Amro Avatar answered Sep 19 '22 13:09

Amro