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?
+2
A:
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/access/helpdesk/help/techdoc/creating_plots/f2-14338.html
Amro
2010-08-30 14:08:30
Hi Amro. Thanks for answering. Okey, I understood the above part ... then what?
Rook
2010-08-30 14:13:25
@Rook: please refer to this page: http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f2-14338.html
Amro
2010-08-30 14:14:18
@Amro - yes, I think I even managed to stumble onto that page while looking for it. But it only deals with the ratio of image on screen/paper. I need a way to specify in cm, for example, how big do I want the image to go out on paper (I have a really big plotter on my disposal, and wish to plot some diagrams that are 50x100cm - but they need to be exactly 50x100cm, since students will read values off them).
Rook
2010-08-30 14:17:24
@Rook: I updated the code.. since I don't have a printer at hand, could you try to see if this works as intended?
Amro
2010-08-30 15:13:22
@Amro - no, it's still not going out right. I modified your program a little (since rand() is difficult, since it gives out a different data every time, so you cannot "play" with parameters) as to print a "box" -> x = [0 5 0 5], y = [0 10 10 0], plot(x,y) <- but on paper it still comes out wrong.
Rook
2010-08-30 15:37:02
@Rook: Can you also try the other approach using PaperPositionMode=auto (after customizing your monitor's DPI settings)? Also make sure to use TIFF images as output (for some reason EPS/PDF seemed to be a bit bigger)
Amro
2010-08-30 15:56:34
@Amro - This approach works ... 5x10 cm exactly on paper. Thanks Amro for all your help. This is very important to me. It will save me a lot of time compared to manually configuring all those print parameters.
Rook
2010-08-30 16:31:16