【源码】绘制图片标题的函数suplabel

将文本放置于一组subplot图片的标题、x轴和y轴坐标上。

Places text as a title, xlabel, or ylabel on a group of subplots.

该函数返回标签和坐标轴的句柄,即:

Returns a handle to the label and a handle to the axis.

[ax,h]=suplabel(text,whichLabel,supAxes)

supAxes是一个可选的输入变量,用于指定subplot周围的"super"坐标轴位置。

supAxes is an optional argument specifying the Position of the “super” axes surrounding the subplots.

supAxes的默认值为[.075 .075 .85 .85]。

supAxes defaults to [.075 .075 .85 .85] specify supAxes if labels get chopped or overlay subplots.

使用示例如下:

subplot(2,2,1);ylabel(‘ylabel1’);title(‘title1’)

subplot(2,2,2);ylabel(‘ylabel2’);title(‘title2’)

subplot(2,2,3);ylabel(‘ylabel3’);xlabel(‘xlabel3’)

subplot(2,2,4);ylabel(‘ylabel4’);xlabel(‘xlabel4’)

[ax,h1]=suplabel(‘super X label’);

[ax,h2]=suplabel(‘super Y label’,‘y’);

[ax,h3]=suplabel(‘super Title’ ,‘t’);

set(h3,‘FontSize’,30)

源码下载地址:

http://page5.dfpan.com/fs/6lc5j2221229516a904/

更多精彩文章请关注微信号:在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42825609/article/details/84914890