## 3-3 ?–è»¸?„æŽ§??

axis([xmin, xmax, ymin, ymax])

Example 1: 03-¤Gºû¥­­±Ã¸¹Ï/plotxy10.mx = 0:0.1:4*pi; % x ¦V¶qªº°_©l»Pµ²§ô¤¸¯À¬° 0 ¤Î % 4£k¡B0.1 ¬°¦U¤¸¯À¬Û®t­È y = sin(x); plot(x, y); axis([-inf, inf, 0, 1]); % µe¥X¥¿©¶ªi y ¶b¤¶©ó 0 % ©M 1 ªº³¡¥÷

¨ä¤¤¨Ï¥Î¨ì ¡V inf ¤Î inf¡A¨Ã¤£¬O¥Nªí¡u­tµL½a¤j¨ì¥¿µL½a¤j¡v¡A¦Ó¬O¥Nªí¥H¸ê®ÆÂI¡]¤W¨Ò¤¤§Y¬O x ¶bªº¸ê®ÆÂI¡^ªº³Ì¤p©M³Ì¤j­È¨Ó¨ú¥N¤§¡A¦]¦¹¤W­z axis «ü¥Oµ¥®Ä©ó axis([min(x), max(x), 0, 1])¡C

Example 2: 03-¤Gºû¥­­±Ã¸¹Ï/plotxy11.mx = 0:0.1:4*pi; plot(x, sin(x)+sin(3*x)) set(gca, 'ytick', [-1 -0.3 0.1 1]); % ¦b y ¶b¥[¤W®æ½uÂI grid on % ¥[¤W®æ½u

°£¤F§ïÅÜ®æ½uÂI¥~¡A¥ç¥i±N®æ½uÂIªº¼Æ¦r§ï¬°¤å¦r¡A¦p¤U¡G

Example 3: 03-¤Gºû¥­­±Ã¸¹Ï/plotxy12.mx = 0:0.1:4*pi; plot(x, sin(x)+sin(3*x)) set(gca, 'ytick', [-1 -0.3 0.1 1]) set(gca, 'yticklabel', {'·¥¤p','Á{¬É­È','±Y¼ì­È','·¥¤j'}) grid on % ¥[¤W®æ½u

­Y­n¦b¤@­Óµøµ¡²£¥Í¦h­Ó¹Ï§Î¡]§Y¹Ï¶b¡^¡A¥i¦b plot «ü¥O¤§«e¥[¤W subplot¡A¨ä¤@¯ë§Î¦¡¬° subplot (m, n, p)¡Aªí¥Ü±Nµøµ¡¹º¤À¬° m¡Ñn ­Ó°Ï°ì¡A¦Ó¤U¤@­Ó plot «ü¥O«h·|Ã¸¹Ï©ó²Ä p ­Ó°Ï°ì¡A¨ä¤¤ p ªººâªk¬°¥Ñ¥ª¦Ü¥k¡A¤@¦C¤@¦Cºâ°_¡CÁ|¨Ò¨Ó»¡¡A¥i¥H¦P®Éµe¥X¥|­Ó¹Ï©ó¤@­Óµøµ¡·í¤¤¡G

Example 4: 03-¤Gºû¥­­±Ã¸¹Ï/plotxy13.mx = 0:0.1:4*pi; subplot(2, 2, 1); plot(x, sin(x)); % ¦¹¬°¥ª¤W¨¤¹Ï§Î subplot(2, 2, 2); plot(x, cos(x)); % ¦¹¬°¥k¤W¨¤¹Ï§Î subplot(2, 2, 3); plot(x, sin(x).*exp(-x/5)); % ¬°¥ª¤U¨¤¹Ï§Î subplot(2, 2, 4); plot(x, x.^2); % ¦¹¬°¥k¤U¨¤¹Ï§Î

Example 5: 03-¤Gºû¥­­±Ã¸¹Ï/plotxy14.mt = 0:0.1:2*pi; x = 3*cos(t); y = sin(t); subplot(2, 2, 1); plot(x, y); axis normal subplot(2, 2, 2); plot(x, y); axis square subplot(2, 2, 3); plot(x, y); axis equal subplot(2, 2, 4); plot(x, y); axis equal tight

axis squareªø¼e¤ñ¨Ò¬° 1
axis equalªø¼e¤ñ¨Ò¤£ÅÜ¡A¦ý¨â¶b¨è«×¤@­P
axis equal tight¨â¶b¨è«×¤ñ¨Ò¤@­P¡A¥B¹Ï¶b¶Kºò¹Ï§Î

colordef white ¹Ï¶b­I´º¬°¥Õ¦â¡Aµøµ¡­I´º¬°²L¦Ç¦â
colordef black ¹Ï¶b­I´º¬°¶Â¦â¡Aµøµ¡­I´º¬°·t¦Ç¦â
colordef none ¹Ï¶b­I´º¬°¶Â¦â¡Aµøµ¡­I´º¬°¶Â¦â¡]³o¬O MATLAB ²Ä 4 ª©ªº¹w³]­È¡^