Lock axes

조회 수: 20 (최근 30일)
Sven Schoeberichts
Sven Schoeberichts 2011년 12월 7일
Hi all,
I am using this way of having 2 dragable lines to change limits within a plot.
But whenever I drag them to the bottom or top of the axes, the axes change their limits, although I manually set them using
aH = axes( 'Xlim', [0 10], 'Ylim', [0 10]);
axis manual;
How can I disable the changing axes?
Any help is much appreciated
  댓글 수: 1
Sven Schoeberichts
Sven Schoeberichts 2011년 12월 7일
axis([0 10 0 10]);
doesn't work either

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

채택된 답변

Jan
Jan 2011년 12월 7일
You can exclude the lines from influencing the AXES limits:
LineH = plot(1:10, rand(1, 10));
try
set(LineH, 'YLimInclude', 'off');
catch
error('Undocumented feature "YLimInclude" failed.');
end
As long as this feature is not documented, a TRY/CATCH helps to reveal problems in future versions. But it works at least since Matlab 6.5 - see: Undocumented: YLimInclude.
  댓글 수: 1
Sven Schoeberichts
Sven Schoeberichts 2011년 12월 8일
Exactly what I needed. I think they should document this..

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by