필터 지우기
필터 지우기

How to Center Align the title for a figure?

조회 수: 26 (최근 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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by