【问题标题】:Get rid of "Figure 1" in the title of the figure去掉图标题中的“图一”
【发布时间】:2012-06-11 08:13:30
【问题描述】:

我有一个图,我希望他的名字是Step 2 of 3: Simulation Plot Window,但它的名字是:figure 2: Step 2 of 3: Simulation Plot Window

我怎样才能把他的名字改成我想要的名字?

我不知道是否有必要,但是在我写的代码的开头:

hFig = figure('Name','window 1','Visible','Off');

在我的代码结束时,我写道:

hFig = figure('Name','Step 2 of 3: Simulation Plot Window','Menubar','none', 'Resize','off', ...
    'WindowStyle','modal', 'Position',[300 300 1150 600]);

【问题讨论】:

    标签: matlab matlab-figure


    【解决方案1】:

    在标题中显示数字是图形的属性之一。 默认情况下,它设置为on,除非您使用的是GUIDE

    无论如何,要删除它,请使用

    set(gcf,'NumberTitle','off');
    

    更好的方法是使用从调用figure 函数获得的句柄:

    hFig = figure('Name','window 1','Visible','Off');
    set(hFig,'NumberTitle','off');
    

    另外,(正如@GuntherStruyf 也提到的),可以在调用figure 函数本身时做到这一点:

    hFig = figure('Name','window 1','Visible','Off','NumberTitle','off');
    

    【讨论】:

    • 您也可以立即将其添加到图形创建本身:hFig = figure('Name','Step 2/3: ...','NumberTitle','off')
    猜你喜欢
    • 2013-12-15
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 2016-03-09
    • 2019-01-11
    • 1970-01-01
    • 2014-07-19
    • 1970-01-01
    相关资源
    最近更新 更多