
Matlab用subplot画图,怎么加总标题
展开全部
你用suptitle命令即可。下面是该命令的帮助文档。
suptitle('text') adds text to the top of the figure
above all subplots (a "super title"). use this function
after all subplot commands.下面是一个例子,注意,最好画完所有的子图后再用suptitle,不然可能会出现和第一个子图的标题覆盖的情况。
clc;clear;close all
x = 0:0.01:4*pi;
y1 = cos(x);
y2 = sin(x);
figure(1)
subplot(2,1,1);
plot(x,y1);
title('cos(x)');
subplot(2,1,2);
plot(x,y2);
title('sin(x)');
suptitle('总标题')下面是结果:
suptitle('text') adds text to the top of the figure
above all subplots (a "super title"). use this function
after all subplot commands.下面是一个例子,注意,最好画完所有的子图后再用suptitle,不然可能会出现和第一个子图的标题覆盖的情况。
clc;clear;close all
x = 0:0.01:4*pi;
y1 = cos(x);
y2 = sin(x);
figure(1)
subplot(2,1,1);
plot(x,y1);
title('cos(x)');
subplot(2,1,2);
plot(x,y2);
title('sin(x)');
suptitle('总标题')下面是结果:
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询