bugGNU Octave - Bugs: bug #62451, xlim([]) gives irritating error...

 
 

bug #62451: xlim([]) gives irritating error message

Submitted by:  Hartmut <hardy>
Submitted on:  Fri 13 May 2022 09:51:52 AM UTC
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 7.1.0 Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Mon 16 May 2022 08:53:26 PM UTC, comment #3: 

Thanks for the fix.

But doesn't xlim.m need any input validation? I'd say user-callable/-visible functions should have that rather than the "hidden" __<somefunc>__ functions.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 15 May 2022 07:39:39 PM UTC, comment #2: 

Interestingly, Octave already had input validation to detect this case and emit a useful warning.  But, there were no BIST input validation tests and at some point in time a conditional was changed from "||" to "&&" and this was disabled.  I will write something about this on Octave Discourse.

I fixed the issue on the stable branch since this a regression.  See http://hg.savannah.gnu.org/hgweb/octave/rev/f69dbed63186.

Marking as Fixed and closing report.

Rik <rik5>
Project Administrator
Sun 15 May 2022 04:19:02 PM UTC, comment #1: 

Yeah, there should be some input validation in -I suppose- xlim.m itself. None of that there at all.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 13 May 2022 09:51:52 AM UTC, original submission:  

The following code

plot(1:10)
xlim([])

gives an irritating error message under Octave (7.1):

error: arg(1): out of bound 0 (dimensions are 0x0) (note: variable 'arg' shadows function)
error: called from
    __axis_limits__ at line 54 column 22
    xlim at line 60 column 7

In Matlab this code also throws an error message, but it's much easier to understand:

Error using xlim (line 31)
Limits must be a 2-element vector of increasing numeric values.

Could we improve our error message in xlim, in order to not confuse users in this case?

Hartmut <hardy>

 

(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 hardy (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 project members can vote.

     

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-05-15 rik5 Item GroupUnexpected Error or Warning => Regression
        StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2022-05-15 philipnienhuis StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.9