フィルターのクリア

How to Center Align the title for a figure?

24 ビュー (過去 30 日間)
Hadi Hajieghrary
Hadi Hajieghrary 2014 年 12 月 24 日
コメント済み: Star Strider 2014 年 12 月 24 日
This is the code I use to title my figures:
title('Agent 1 \newline Probability Density Function - Step 1','FontWeight','bold',... 'FontSize',12,... 'FontName','Times New Roman');
The problem is Matlab left-align the text in title:
Agent 1 Probability Density Function - Step 1
which is ugly!. My question is How can I Center-Align it as:
Agent 1
Probability Density Function - Step 1
Thanks, Hadi

採用された回答

Star Strider
Star Strider 2014 年 12 月 24 日
編集済み: Star Strider 2014 年 12 月 24 日
Try this:
ttl = sprintf('Agent 1\nProbability Density Function - Step 1');
title(ttl,'FontWeight','bold', 'FontSize',12, 'FontName','Times New Roman');
  2 件のコメント
Hadi Hajieghrary
Hadi Hajieghrary 2014 年 12 月 24 日
Great! Thanks.
Hadi
Star Strider
Star Strider 2014 年 12 月 24 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by