after jacobko's answer. Setting paper properties and paper properties, as well as axis units and position properties, usually gives me the desired results without having to adjust the resolution. In this way,
>> im = imread('image.tif'); >> f = figure, imshow(im); >> r=rectangle('Position',[100, 100,10,10]); >> set(r,'edgecolor','b') % change the color of the rectangle to blue >> set(f,'units','centimeters','position',[1 1 2.5 2.5]) % set the screen size and position >> set(f,'paperunits','centimeters','paperposition',[1 1 2.5 2.5]) % set size and position for printing >> set(gca,'units','normalized','position',[0 0 1 1]) % make sure axis fills entire figure >> print(f, '-r80','-dtiff','image2.tif')
The output image, image2.tif, will now be 2.5 cm by 2.5 cm with a resouttion of 80dpi with no border around the axis.
Azim Feb 23 '09 at 17:33 2009-02-23 17:33
source share