Changing y axis range

조회 수: 8 (최근 30일)
Abhinaya
Abhinaya 2016년 6월 23일
편집: Muhammad Usman Saleem 2016년 6월 23일
The y-limit in my plot is automatically scaled and it does not take the ylim I specify. How do I fix this
  댓글 수: 1
dpb
dpb 2016년 6월 23일
Say "please?", maybe?

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

답변 (2개)

dpb
dpb 2016년 6월 23일
How are we to know? The point of the above comment is that without knowing what you're doing there's nothing we can say specifically; we can't see your terminal session from here.
But, the documentation on ylim in the Tips section says--
"When the axis limit mode is set to auto (the default), MATLAB uses limits, which are round numbers, to span the range of the data being displayed. Setting a value for any of the limits also sets the corresponding mode to manual. If you set the limits on an existing graph and want to maintain these limits while adding more graphs, use the hold command."
It goes on to point out, however:
"Note:  High-level plotting functions like plot and surf reset both the modes and the limits."
The crystal ball says the latter is likely your culprit...

Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 6월 23일
편집: Muhammad Usman Saleem 2016년 6월 23일
try this
ylim([20.5 37.5]);
set(gca, 'clim', [min(Ci(:)) max(Ci(:))]);
Ci will be matrix

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by