首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MATLAB子图标题和轴标签

MATLAB子图标题和轴标签
EN

Stack Overflow用户
提问于 2010-08-11 07:56:34
回答 4查看 65.2K关注 0票数 7

我有以下脚本来最终绘制一个4x2的子图:

代码语言:javascript
运行
复制
files = getAllFiles('preliminaries');

n = size(files);
cases = cell(1, n);
m = cell(1, n);

for i = 1:1:n
    S = load(files{i});

    cases{i} = retransmission_distribution(S);

    c = size(cases{i});
    m{1,i} = cell(1, c(2));

    %figure(i);
    str_size = size(files{i});
    title_str = files{i}(5:str_size(2) - 4);
    title_str = strrep(title_str, '_', ' ');
    %title(title_str);
    for j = 1:1:c(2)
        [x, y] = hist(cases{i}{1,j});
        m{1,i}{1,j} = [x; int32(y)];
        %  subplot(4, 2, j);
        %  xlabel('Number of Retransmissions');
        %  ylabel('Number of Occurrences');
        %  bar(y, x, 'histc');
    end
end

然而,按照命令序列的当前顺序,即使它们没有注释,标题和轴标签在被擦除之前也会存在一段时间。我希望图形有自己的标题,每个子图都有自己的轴标签。修复它最简单的方法是什么?

EN

Stack Overflow用户

发布于 2013-02-23 16:57:05

suptitle就是你要找的东西。

它将标题置于所有绘图的中心位置。

代码语言:javascript
运行
复制
SUPTITLE Puts a title above all subplots.
    SUPTITLE('text') adds text to the top of the figure
    above all subplots (a "super title"). Use this function
    after all subplot commands.
票数 5
EN
查看全部 4 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3454369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档