Change plot title of saved figure

58 ビュー (過去 30 日間)
DraUX
DraUX 2023 年 9 月 21 日
コメント済み: DraUX 2023 年 9 月 21 日
Is there a way to edit the title of a plot after saving and reloading the figure? I created a lot of figures with a tiledlayout and after saving them I realised I have to change the title. I can't find a way to edit that in the properties editor, neither do I know how to edit it by code.
At the moment I am trying that
myfig = openfig("name_of_my_fig.fig");
title(myfig,"pls_change_the_title")
The blue marked title is what I want to change.

回答 (1 件)

Pratyush
Pratyush 2023 年 9 月 21 日
Hi @DraUX,
I understand that you want to update the title of a figure after saving it.
You can follow these steps:
myfig = openfig("name_of_my_fig.fig");
% Access the axes of the figure using the 'gca' function:
ax = gca;
% Modify the title of the plot using the 'title' function:
title(ax, 'New Title');
% Optionally, you can update the figure to reflect the changes:
drawnow;
% If you want to save the modified figure with the new title, you can use the savefig function again:
savefig('myfigure_modified.fig');
  3 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 21 日
@DraUX Can you attach the figure here? Use the paperclip button to attach.
DraUX
DraUX 2023 年 9 月 21 日

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

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by