bugGNU Octave - Bugs: bug #56849, contour documentation misleading

 
 

bug #56849: contour documentation misleading

Submitted by:  Muhali <muhali>
Submitted on:  Mon 02 Sep 2019 03:40:52 PM UTC  
 
Category:  Plotting Severity:  1 - Wish
Priority:  3 - Low Item Group:  Documentation
Status:  Fixed Assigned to:  Kai Torben Ohlhus <siko1056>
Originator Name:  Open/Closed:  Closed
Release:  5.1.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Tue 03 Sep 2019 09:03:05 AM UTC, comment #6: 

Thank you again.  I pushed the following cset https://hg.savannah.gnu.org/hgweb/octave/rev/d9d10a49926d.  It will be part of the next Octave release.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Tue 03 Sep 2019 08:50:51 AM UTC, comment #5: 

Confirmed.  Indeed your example from comment #2 is better.

The misleading example from comment #3 got truncated by good old Savannah. I received it via mail:

x = 0:2;
y = 0:3;
z = x' * y;
contour (x, y, z, 2:3)

error: __contour__: size of X must match number of columns in Z
error: called from
    __contour__ at line 88 column 9
    contour at line 74 column 18

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Tue 03 Sep 2019 08:41:24 AM UTC, comment #4: 

it happens if you follow the example, but using a non-square matrix, e.g.

Muhali <muhali>
Tue 03 Sep 2019 08:34:24 AM UTC, comment #3: 

Never mind. But I still do not see the documentation improvement nor understand the error you experienced.  Please can you give the exact sequence of commands that lead to your described error?

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Tue 03 Sep 2019 07:08:51 AM UTC, comment #2: 

There was a typo in my post, sorry. It must read

Example:

          x = 0:3;
          y = 0:2;
          z = y' * x;
          contour (x, y, z, 2:3)

Muhali <muhali>
Tue 03 Sep 2019 03:20:31 AM UTC, comment #1: 

Please can you give the exact sequence of commands that lead to your described error?  I suspect you did not update all values properly when modifying "x".  The following works for me:

x = 0:2;      # [0   1   2]
y = x;        # [0   1   2]
z = x' * y

z =

   0   0   0
   0   1   2
   0   2   4

contour (x, y, z, 2:3) # works

and


x = 0:0.5:2;  # [0.00000    0.50000    1.00000    1.50000    2.00000]
y = x;        # [0.00000    0.50000    1.00000    1.50000    2.00000]
z = x' * y

z =

   0.00000   0.00000   0.00000   0.00000   0.00000
   0.00000   0.25000   0.50000   0.75000   1.00000
   0.00000   0.50000   1.00000   1.50000   2.00000
   0.00000   0.75000   1.50000   2.25000   3.00000
   0.00000   1.00000   2.00000   3.00000   4.00000

>> contour (x, y, z, 2:3)  # works

I do not understand what makes your example less error prone than the previous one.

x = 0:3;
y = x;
z = y' * x
z =

   0   0   0   0
   0   1   2   3
   0   2   4   6
   0   3   6   9

The matrix "z" to be plottet in your example will be square as well?

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Mon 02 Sep 2019 03:40:52 PM UTC, original submission:  

The help text for the contour function

Example:

          x = 0:2;
          y = x;
          z = x' * y;
          contour (x, y, z, 2:3)

is misleading, because one is made to believe that one can simply replace x by e.g. 0:0.5:2 to run the same example. But that throws the error

error: _contour_: size of X must match number of columns in Z
error: called from
    _contour_ at line 88 column 9
    contour at line 74 column 18

This is caused by the definition of z, and can be avoided by letting z = y' * x. Moreover, a non-square matrix for z clarifies things, so I recommend a help text such as

Example:

          x = 0:3;
          y = x;
          z = y' * x;
          contour (x, y, z, 2:3)

Muhali <muhali>

 

(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 siko1056 (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-03 siko1056 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2019-09-03 siko1056 StatusNeed Info => In Progress
        Assigned toNone => siko1056
        Operating SystemGNU/Linux => Any
    2019-09-03 siko1056 Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
        StatusNone => Need Info
        Summarycontour documentation wrong => contour documentation misleading

    Back to the top


    Powered by Savane 3.5