> 文章列表 > matlab中subplot用法

matlab中subplot用法

matlab中subplot用法

subplot就是将Figure中的图像划分为几块,每块当中显示各自的图像,利于进行比较。

比如Example里面有这样的例子

income = [3.2 4.1 5.0 5.6];

outgo = [2.5 4.0 3.35 4.9];

subplot(2,1,1); plot(income)

subplot(2,1,2); plot(outgo)

先用baisubplot划分Figure为2*1的区域,上面一个显示income,下面一个显示outgo。

subplot的格式为(行数,列数,第几个区域的位置),不加逗号也是可以的。