How to change 'figure' title to wanted text

55 ビュー (過去 30 日間)
Danny Maefengea
Danny Maefengea 2020 年 6 月 18 日
コメント済み: Danny Maefengea 2020 年 6 月 18 日
Hi
I created a figure (graph) and I want to change the "figure" title to an intended text. How can I do that?
Thank you and looking forward for your help.
Here is what I've done :
%Assigning wave height to variable H
H = data;
%plotting the data (H) on a bar graph
figure('St Kilda Wave Height','H','1','off') % I want to change the title in the window "figure1" to this text.
bar(H,'r')
grid on
xlabel('Wind Speed (m/s)')
ylabel('Wave height (mm)')
%figure('St Kilda Wave Height','H','1','off')
ave_wave_height = mean(H) %Calculating the average wave height of the data
stdev = std(H) %Calculating the standard deviation of the data
title(['Avarage Wave Height (mm): ',num2str(ave_wave_height), ' Standard Deviation: ',num2str(stdev)])

採用された回答

Aayush Shah
Aayush Shah 2020 年 6 月 18 日
Hi Danny,
My understanding of your question is that you aren’t able to change the default name of the figure from ‘Figure 1’ to something that you want to. So, the way you do it is use the following code instead of the code you mentioned in bold.
figure('Name','St Kilda Wave Height','NumberTitle','off')
This would solve your issue.
  1 件のコメント
Danny Maefengea
Danny Maefengea 2020 年 6 月 18 日
Thank you sir

サインインしてコメントする。

その他の回答 (2 件)

madhan ravi
madhan ravi 2020 年 6 月 18 日
figure("Name","That's what i want")
  1 件のコメント
Danny Maefengea
Danny Maefengea 2020 年 6 月 18 日
Thank you sir

サインインしてコメントする。


Ameer Hamza
Ameer Hamza 2020 年 6 月 18 日
fig = figure('Name', 'St Kilda Wave Height', 'NumberTitle', 'off');
  1 件のコメント
Danny Maefengea
Danny Maefengea 2020 年 6 月 18 日
Thank you sir.

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by