I have a problem while i'm trying to plot some data // Error using matlab.graphics.axis.Axes/set
조회 수: 68 (최근 30일)
이전 댓글 표시
Error using matlab.graphics.axis.Axes/se
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf
This is the message that appears in the command window
댓글 수: 0
답변 (2개)
Walter Roberson
2018년 5월 5일
You would get that if you tried to set() the axes XLim or YLim for a regular numeric plot, but you had a problem with the values you passed.
When you set() XLim or YLim, you need to pass a vector of exactly two elements. Both elements must be numeric -- you cannot set the XLim for a numeric plot to be datetime() values for example. Neither element may be nan. The second element must be strictly greater than (not equal to) the first. It is acceptable for the first element to be -inf and it is acceptable for the second element to be +inf.
For example, using [9 3] or [9 9] would not be accepted because the second element is not strictly greater than the first.
댓글 수: 2
Bachtiar Muhammad Lubis
2019년 2월 6일
@walter roberson : i have passed handle.axes1 object. and then i got error same as him. what would i do to solve then sir ? while i passed handle.object from my another program ito xlim() t worked properly.
Walter Roberson
2019년 2월 6일
At the time you do the set(), what is the XLim or YLim that you are trying to set, and what is the datatypes of the xdata and ydata of what you graphed ?
You could get this problem with one axes but not another if the two axes were different kinds of axes. For example if one axes was a datetime axes then it would be fine to set datetime xlim for it, but it would not be acceptable to set datetime xlim for a numeric axes.
Akash kumar
2021년 3월 22일
편집: Akash kumar
2021년 3월 22일
Dear Luis Salas,
These Problem occur:-- if you do not properly assgin the axis like :-- axis([50 8 50 85]);-- Gives the error:- because 1'st element value is less than the second element value (in x axis part), similarly for y axis.
Proper assginment of the aforementioned example is:-axis([50 80 50 85]);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!