bugGNU Octave - Bugs: bug #52176, contourf() does not enforce size...

 
 

bug #52176: contourf() does not enforce size compatibility

Submitted by:  None
Submitted on:  Fri 06 Oct 2017 11:46:04 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Missed Error or Warning
Status: FixedAssigned to: None
Originator Name: William RosenthalOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 17 Oct 2017 04:01:47 PM UTC, comment #4:

I checked in a changeset that does stricter validation of inputs for all the contour functions (http://hg.savannah.gnu.org/hgweb/octave/rev/ea06ac500348). This was done on the development branch and will be a part of the next major release (4.4.0). But, because the change is just in an m-file, you can grab the latest copy from the Mercurial repository and put it in your local distribution if you want to see the change immediately.

Rik <rik5>
Project Administrator
Tue 17 Oct 2017 03:21:37 PM UTC, comment #3:

Marking as confirmed. Looks like the input validation needs to be tightened up.

Rik <rik5>
Project Administrator
Tue 17 Oct 2017 12:13:05 PM UTC, comment #2:

Matlab 2016b

Anonymous
Sat 14 Oct 2017 10:26:54 PM UTC, comment #1:

How does Matlab handle the sample code? Does it issue an error or does it choose a padding scheme?

Rik <rik5>
Project Administrator
Fri 06 Oct 2017 11:46:04 AM UTC, original submission:

ERROR: contourf(x,y,f) plots without error an array f which is smaller in at least 1 dimension than the length of the coordinate vectors x and y.

IMPACT: This results in unexpected behavior, because it is not obvious whether the function will pad the plot with white space, pad the array with zeros, or truncate the excessive x or y vector. It also is not obvious whether the function will align the array with the first or last values of the excessive x or y vector. The lack of precise input checking also allows dimension mismatch issues to persist, and makes overall debugging more difficult.

MINIMAL EXAMPLE: This code should, but does not, throw an error citing dimension mismatch between the array A and one or more of the coordinate vectors x and y:

clc, clear all, close all
A = zeros(100,99);
for j = 1:100, for k = 1:99, A(j,k) = j + 2*k; end, end
x = (1:100)';
y = (1:100)';
contourf(y,x,A), colorbar, xlabel('x'), ylabel('y')

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 17 Oct 2017 04:01:47 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Tue 17 Oct 2017 03:21:37 PM UTCrik5CategoryPlotting=>Octave Function
      StatusNeed Info=>Confirmed
      Operating SystemMicrosoft Windows=>Any
    Sat 14 Oct 2017 10:26:54 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1