Get rid of “Figure 1” in the title of the figure

ε祈祈猫儿з 提交于 2019-12-21 03:44:32

问题


I have a figure that I want his name to be Step 2 of 3: Simulation Plot Window, but its name is: figure 2: Step 2 of 3: Simulation Plot Window.

How can I change his name to the name I want?

I don't know if it's necessary, but in the start of the code I wrote:

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

and Towards my code ends, I write:

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

回答1:


Showing the number in the title is one of the properties of the figure. By default it is set to on, unless you are using GUIDE.

Anyway, in order to remove it, use

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

A better way would be to use the handle that you got from a call to the figure function:

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

Also, (as @GuntherStruyf also mentioned), it is possible to do it in the call to the figure function itself:

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


来源:https://stackoverflow.com/questions/10929020/get-rid-of-figure-1-in-the-title-of-the-figure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!