19-2 ������������������������

MATLAB bܼvɡA|Nmw]϶bAåH϶beӦA]ӳyvuCYnHveӦAi[J axis imageApU:

Example 1: 19-vܻPŪg/image05.mload mandrill.mat image(X); colormap(map); colorbar; axis image

bWzdҤApGϥΡuaxis imagevAeXӪϪjpNO MATLAB w]϶bjpAҥH|o@ӤҤ諸uDUlvC]pGɧAhܵjpANiHݨϧΪҤ]|ۧܡC^

YnϼvƪC@IܿùW@ӹ]Pixel^AiJpU:

Example 2: 19-vܻPŪg/image06.mload mandrill.mat [m, n] = size(X); figure ('unit', 'pixel', 'position', [200, 200, n, m]); image(X); colormap(map); set(gca, 'position', [0, 0, 1, 1]);

dҲ͹ϧΦpPe@ӽdҡAOvƪC@IiHùW@ӹAҥHpGAùѪR׸CAϧη|ܤjCbWzdҵ{XA figure 'position' ʽ謰 [200, 200, n, m]ANUmO [200, 200]]H pixel ^Aӵe׬ nA׬ mAniHŦXvjpCgca Ǧ^ϥΤ϶bAWҪ̫@ӱԭzN϶bm]ӵjpAϥΤFWƪ]Normalized Unit^C] gca set OAиԨѲĤCu⦡ϧλP GUI ]pvC^

Hint
`ΨF\h⦡ϧΡ]Handle Graphics^\AYnDhӸ`AiѦҥѲĤCu⦡ϧλP GUI ]pvC

bCLvɡAMATLAB |ھڵ Paper position ʽӽվϧΪeAϱoLXvAܧΡCpAiUF@COG

>>set(gcf, 'PaperPositionMode', 'auto')

YiLX`vC䤤 gcf Ǧ^ϥΤANPaper Position Mode]autoAhbCLɦCLXe|Mܦbùe@ˡC

Yn Paper Position Mode w]ȴNOautoAib startup.m ɮפ[JU@:

>>set(0, 'DefaultFigurePaperPositionMode', 'auto')
MATLAB{]pGJg