bugGNU Octave - Bugs: bug #52536, contourc docstring typo:...

 
 

bug #52536: contourc docstring typo: correspondence of dimensions and axes

Submitter:  Antons Suspans <antox>
Submitted:  Mon 27 Nov 2017 07:27:48 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 28 Nov 2017 01:16:33 AM UTC, comment #2: 

use

grep -rIB1 '1:\(rows\|columns\) (@var{z})' /usr/share/octave/4.2.1/m/plot/


and find the following functions have the same typo:
contourc
surfnorm
surface

while the following functions are correct:
waterfall
surfl
meshc
mesh
surfc
surf

Anonymous
Tue 28 Nov 2017 12:59:46 AM UTC, comment #1: 

Yep, thanks for noticing that.  It's pretty clear in the m-file as well.  The code for a single input, i.e., Z is


  if (nargin == 1)
    z = varargin{1};
    x = 1:columns (z);
    y = 1:rows (z);


so it is quite clear that x is using columns of z and y is using rows of z.

It turns out there were three other Octave plotting functions that had the same incorrect explanation.  I fixed contourc and the others on the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/3cdd2b6c78cb).  It will be a part of the 4.2.2 bug fix release expected at the end of this year.

Marking as fixed and closing report.


Rik <rik5>
Group administrator
Mon 27 Nov 2017 07:27:48 PM UTC, original submission:  

Docs say that contourc(Z) uses X=1:rows(Z) and Y=1:columns(Z) but it is vice versa (contour behaves consistently with surfc, etc).


c=contourc([0 2;0 2], 1)
c =

   1.0000   1.5000   1.5000
   2.0000   1.0000   2.0000

contour([0 2;0 2]), xlabel x


Diff:

--- old/octave/4.2.1/m/plot/draw/contourc.m
+++ new/octave/4.2.1/m/plot/draw/contourc.m
@@ -25,8 +25,8 @@
 ##
 ## The matrix @var{z} contains height values above the rectangular grid
 ## determined by @var{x} and @var{y}.  If only a single input @var{z} is
-## provided then @var{x} is taken to be @code{1:rows (@var{z})} and @var{y} is
-## taken to be @code{1:columns (@var{z})}.
+## provided then @var{x} is taken to be @code{1:columns (@var{z})} and @var{y}
+## is taken to be @code{1:rows (@var{z})}.
 ##
 ## The optional input @var{vn} is either a scalar denoting the number of
 ## contour lines to compute or a vector containing the Z values where lines


Antons Suspans <antox>

 

(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 antox (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-28 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code