bugGNU Octave - Bugs: bug #49766, ezplot of constant fcn fails:...

 
 

bug #49766: ezplot of constant fcn fails: error: axis: LIMITS(3) must be less than LIMITS(4)

Submitter:  Colin Macdonald <cbm>
Submitted:  Mon 05 Dec 2016 07:11:03 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 12 Dec 2016 02:51:44 PM UTC, comment #5: 

I fixed ezplot on the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/9b096bffc10d).  Closing report.

Rik <rik5>
Group administrator
Wed 07 Dec 2016 05:49:38 PM UTC, comment #4: 

Error,


>> clf
>> plot([2 2 2], 'o-')
>> ylim
ans =
     1     3

>> ylim([2 2])
??? Error using ==> set
Bad value for axes property: 'YLim'
Values must be increasing and non-NaN.

Error in ==> ylim at 44
    set(ax,'ylim',val);

>> ylim
ans =
     1     3


Colin Macdonald <cbm>
Mon 05 Dec 2016 10:04:38 PM UTC, comment #3: 

@Colin: Could you check another thing on Matlab?


clf
plot ([2 2 2], 'o-')
ylim ([2 2])


Does it issue a warning or error on the call to ylim?  Does it ignore the equal upper/lower bound and set the ylim to 2 +/- 1?

Rik <rik5>
Group administrator
Mon 05 Dec 2016 06:35:33 PM UTC, comment #2: 

Matlab: "ezplot(@(x) c)" seems to have ylim of [c-1 c+1].

Too bad Savannah doesn't allow tagging "easyfix" or something...  Can you prepend "[easytag]" to the subject?  Doesn't look like I can.

Having such a list seems like a good way to attract talent! 

Colin Macdonald <cbm>
Mon 05 Dec 2016 04:41:31 PM UTC, comment #1: 

What are the limits in Matlab after executing ezplot for the sample?


ezplot(@(x) 2*ones(size(x)))
axis


This is easy to fix.  The issue is in _ezplot_.m where Octave finds the limits of the data and then calls axis.  But if the data is constant then the upper and lower limits for one of the axes are the same and the axis() function issues an error.

Rik <rik5>
Group administrator
Mon 05 Dec 2016 07:11:03 AM UTC, original submission:  


>> ezplot(@(x) 2*ones(size(x)))
error: axis: LIMITS(3) must be less than LIMITS(4)
error: called from
    axis>__axis__ at line 309 column 9
    axis at line 152 column 7
    __ezplot__ at line 441 column 11
    ezplot at line 76 column 19


If you don't vectorize, you get a slightly different error:


>> ezplot(@(x) 2)
error: XX(0): subscripts must be either integers 1 to (2^31)-1 or logicals
error: called from
    __ezplot__>find_valid_domain at line 497 column 12
    __ezplot__ at line 387 column 18
    ezplot at line 76 column 19


Both work in Matlab and DTRT.

Colin Macdonald <cbm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cbm (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-12 rik5 Open/ClosedOpen Closed
    2016-12-12 rik5 StatusConfirmed Fixed
    2016-12-05 rik5 StatusNone Confirmed
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code