How to change the position of a shared axis label in a TiledChartLayout?

조회 수: 22 (최근 30일)
Hi,
Given T is a handle to a TiledChartLayout, I tried:
T.XLabel.Position=[val val val val]
but since there is no Position field for class 'matlab.graphics.layout.Text', it isn't working.
Thanks.
  댓글 수: 2
Luna
Luna 2020년 8월 25일
Can you please share a full code of your plot so that we can run and see what's happening and explain the position change you want to do?
yonatan s
yonatan s 2020년 8월 25일
figure
T=tiledlayout(2,2);
nexttile
plot(rand(5));
nexttile
plot(rand(5));
nexttile
plot(rand(5));
nexttile
plot(rand(5));
xlabel(T,'xlabel','Fontsize',30);
I want to be able to play with the xlabel position

댓글을 달려면 로그인하십시오.

채택된 답변

Divija Aleti
Divija Aleti 2020년 8월 31일
For a tiled layout, changing the horizontal and vertical alignment properties of the text is possible. Refer to this link:
A workaround would be to plot using subplots and then change the position of the text using the ‘Position’ property. Have a look at the following example:
figure
subplot(2,2,1)
plot(1:10)
subplot(2,2,2)
plot(1:10)
subplot(2,2,3)
plot(1:10)
subplot(2,2,4)
plot(1:10)
title('xlabel')
set(get(gca,'title'),'Position',[-1.5 -3],'FontSize',20)
Additional reference links:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by