필터 지우기
필터 지우기

Labelling several axes with the same name

조회 수: 1 (최근 30일)
David Polcari
David Polcari 2012년 5월 3일
I have a figure with four subplots. I would like the x-axis to be labelled as "position" for all of them. How can I do this with one line of code?
  댓글 수: 1
Daniel Shub
Daniel Shub 2012년 5월 3일
Duplicate to http://www.mathworks.com/matlabcentral/answers/37239-labelling-several-axes-with-the-same-name

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

채택된 답변

Daniel Shub
Daniel Shub 2012년 5월 3일
Building on Jan's answer ...
H(1) = subplot(1,2,1);
H(2) = subplot(1,2,2);
Htemp = get(H, 'XLabel');
set([Htemp{:}], 'String', 'position');

추가 답변 (1개)

Jan
Jan 2012년 5월 3일
H(1) = subplot(1,2,1);
H(2) = subplot(1,2,2);
set(get(H, 'XLabel'), 'String', 'position');
Does this work? I cannot test it currently.
  댓글 수: 1
Daniel Shub
Daniel Shub 2012년 5월 3일
No, get(H, 'XLabel') returns a cell array that set doesn't like. See my answer for one fix.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by