How can I arrange the ylabels using subplot and plotyy such that they do not overlap?

조회 수: 3 (최근 30일)
Hi all:
When I combine the plotyy and subplot command the ylabels overlap:
figure
for i = 1:2
subplot(1,2,i);
ax = plotyy(1:10,randn(10,2),1:10,randn(10,2));
set(get(ax(1),'Ylabel'),'String','label1')
set(get(ax(2),'Ylabel'),'String','label2')
end
Does anybody have an idea how to resolve this issue?
Best, Peter

채택된 답변

Thorsten
Thorsten 2013년 2월 20일
You may want to move your current subplot to the right
pos = get(gca, 'Position');
pos(1) = pos(1) + 0.05;
set(gca, 'Position', pos)
  댓글 수: 3
Thorsten
Thorsten 2013년 2월 20일
편집: Thorsten 2013년 2월 20일
For each subplot
pos = get(gca, 'Position');
pos(3:4) = 0.8*pos(3:4);
set(gca, 'Position', pos)

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

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 2월 20일
Isn't there a 'Position' property you can also set?

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by