📄 ch3_1_2.htm
字号:
<! Made by Html Translation Ver 1.0>
<HTML>
<HEAD>
<TITLE> 子图 </TITLE>
</HEAD>
<BODY BACKGROUND="bg0000.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/bg0000.gif">
<FONT COLOR="#0000FF">
<H1>3.1.2 子图</H1>
</FONT>
<HR>
<P>
要将数个相关的图画在同一页时,可以用<FONT COLOR=#FF0000 FACE="Times New Roman">subplot</FONT>这个指令。其语法为<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">subplot(m,n,p)</FONT>,其中<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">m</FONT><FONT FACE="Times New Roman">,</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">
n</FONT>代表绘图成<FONT FACE="Times New Roman"> <I>m</I> x <I>n</I>
</FONT>个子图,<FONT COLOR=#FF0000 FACE="Times New Roman">m</FONT>表示在<FONT FACE="Times New Roman">
y</FONT>方向有<FONT FACE="Times New Roman"> <I>m</I> </FONT>个图,<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">n</FONT>表示在<FONT FACE="Times New Roman">
x </FONT>方向有<FONT FACE="Times New Roman"> </FONT><TT><I><FONT FACE="Courier New">n</FONT></I></TT><FONT FACE="Times New Roman">
</FONT>个图,<TT><FONT FACE="Courier New">p</FONT></TT><FONT FACE="Times New Roman">
</FONT>是代表第几个子图。下例是以<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">subplot</FONT>分别画
出线性及对数尺度的四个子图:
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> x=[0 2 5 7
10 12 15 17 20 21];</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> y=[0.1 0.2
0.5 0.6 0.9 1 1.2 1.26 1.22 1.2];</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> subplot(2,2,1),
plot(x,y) % </FONT><FONT COLOR=#FF0000>画左上角的图</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> subplot(2,2,2),
semilogx(x,y) % </FONT><FONT COLOR=#FF0000>画右上角的图</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> subplot(2,2,3),
semilogy(x,y) % </FONT><FONT COLOR=#FF0000>画左下角的图</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> subplot(2,2,4),
loglog(x,y) % </FONT><FONT COLOR=#FF0000>画右下角的图
<BR>
</FONT><HR>
<A HREF="ch3_1_1.htm" tppabs="http://166.111.167.223/computer/cai/matlabjc/ch3_1_1.htm"><IMG SRC="lastpage.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/lastpage.gif" BORDER=0></A>
<A HREF="ch3_1_3.htm" tppabs="http://166.111.167.223/computer/cai/matlabjc/ch3_1_3.htm"><IMG SRC="nextpage-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/nextpage.gif" BORDER=0 HSPACE=10></A>
<A HREF="index.html" tppabs="http://166.111.167.223/computer/cai/matlabjc/index.html"><IMG SRC="outline-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/outline.gif" BORDER=0 HSPACE=6></A><BR>
<FONT SIZE=2 COLOR=#AA55FF> 上一页 下一页 讲义大纲 </FONT>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -