How do I right or left justify text in my plot?
조회 수: 21 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2011년 6월 23일
편집: MathWorks Support Team
2020년 7월 7일
How do I right or left justify text in my plot?
The Handle Graphics property 'HorizontalAlignment' does not right justify the text in my title as I expected. I want my title to appear on the top right-hand side of my figure.
채택된 답변
MathWorks Support Team
2020년 7월 7일
편집: MathWorks Support Team
2020년 7월 7일
To justify text in your figure, you will need to change both the HorizontalAlignment and Position properties. These properties are described in more detail at the following URL:
The following code demonstrates one way that you could right justify your title.
plot(1:10)
t = title('hi')
set(t, 'horizontalAlignment', 'right')
set(t, 'units', 'normalized')
h1 = get(t, 'position')
set(t, 'position', [1 h1(2) h1(3)])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!