How to hide "Figure" the window title bar for a matlab figure?

31 ビュー (過去 30 日間)
SL
SL 2016 年 10 月 23 日
編集済み: the cyclist 2016 年 10 月 23 日
I want to retain the figure number but remove the word "Figure". I can do but it removes the figure number
% https://se.mathworks.com/matlabcentral/newsreader/view_thread/71110
f = figure('numbertitle', 'off');
MATLAB: 2016b OS: Debian 8.5

採用された回答

the cyclist
the cyclist 2016 年 10 月 23 日
編集済み: the cyclist 2016 年 10 月 23 日
If I am understanding you correctly, that you want the automatic figure numbering, then you can do this:
figure
fn = get(gcf,'Number');
set(gcf,'Name',sprintf('%d',fn),'NumberTitle','off')
You can embed that second line into the last one, if you want:
figure
set(gcf,'Name',sprintf('%d',get(gcf,'Number')),'NumberTitle','off')
You could also get clever and anticipate the current figure number from the prior figure (if there is one), and do it all in one line:
figure('Name',sprintf('%d',get(gcf,'Number')+1),'NumberTitle','off')
But that is getting a little hazardous in assuming a prior figure, the fact that none of the prior ones were deleted, etc. So, I would stick with one of the other versions.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by