Error using 'YLim' for NEGATIVE Values (in plot\gca\YLim)
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello,
Please assist in getting below issue resolved.
We intend to define NEGATIVE values in Ylim parameter in gca for plotting purpose.
Sincerely,
A
*> A. TASK:*
1. Plot NEGATIVE VALUES ranging from -50 to -30. (-50 : -30)
2. In plotted figure, Demonstrate Y-Axis range from (-60 : -10)
*> B. ERROR:*
When YLim is used, following error is received:
"
Subscript indices must either be real positive integers or logicals.
Error in YTickIssue (line 11)
ax1.YLim([-60 -20]); "
*> C. CODE:*
"
x = [1:1:5];
y = [-36,-32,-46,-35,-37];
plot(x,y);
ax1 = gca;
ax1.YLim([-60 -20]);
"
댓글 수: 0
답변 (1개)
Star Strider
2016년 6월 9일
That is not the correct way to set the YLim property.
Try this instead:
ax1.YLim = [-60 -20];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!