子图组的标题 [英] Title over group of subplots

查看:97
本文介绍了子图组的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多子图,每个子图都有自己的标题.如何在所有这些子图组上添加标题? 我希望此标题显示在顶部中心.

there are many subplots and each subplot has its own title. how can add a title over all of these group of subplots? I want this title to be shown at top center.

x = linspace(-5,5);

y1 = sin(x);
subplot(2,5,[1:2])
plot(x,y1)
title('y=sin(x)')

y2 = cos(x);
subplot(2,5,[3:4])
plot(x,y2)
title('y=cos(x)')

y3 = tan(x);
subplot(2,5,[5,10])
plot(x,y3)
title('y=tan(x)')

y4 = sin(2*x);
subplot(2,5,[6:7])
plot(x,y1)
title('y=sin(2x)')

y5 = cos(2*x);
subplot(2,5,[8:9])
plot(x,y2)
title('y=acos(2x)')

推荐答案

x = linspace(-5,5);

y1 = sin(x);
subplot(2,5,[1:2])
plot(x,y1)
title('y=sin(x)')

y2 = cos(x);
subplot(2,5,[3:4])
plot(x,y2)
title('y=cos(x)')

y3 = tan(x);
subplot(2,5,[5,10])
plot(x,y3)
title('y=tan(x)')

y4 = sin(2*x);
subplot(2,5,[6:7])
plot(x,y1)
title('y=sin(2x)')

y5 = cos(2*x);
subplot(2,5,[8:9])
plot(x,y2)
title('y=acos(2x)')

suptitle('my title');

这篇关于子图组的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆