bugGNU Octave - Bugs: bug #38864, meshgrid problem with 3D data

 
 

bug #38864: meshgrid problem with 3D data

Submitter:  None
Submitted:  Wed 01 May 2013 09:30:18 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Leon Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 May 2013 01:58:24 AM UTC, comment #1: 

Thanks for your report. However, this is not a bug but the correct operation of the meshgrid function. All 3D plotting routines follow the same convention of indexing X coordinates by column and Y coordinates by row. These conventions are also compatible with the Matlab functions of the same names.

This may seem to be the reverse of the size command and of typical functions that create matrices with M rows and N columns. However, reading the help text for the meshgrid, mesh, and surf functions should make it clear. Would you like to suggest additions or changes to the documentation for any of these functions?

Mike Miller <mtmiller>
Group Member
Wed 01 May 2013 09:30:18 PM UTC, original submission:  

Seems like meshgrid command unnaturally swaps X and Y data.

Proceed:

octave:43> [x, y, z] = meshgrid (1:5, 1:10, 1:5);
octave:44> val = rand (5, 10, 5);
octave:45> isosurface (x, y, z, val, .5);
error: __marching_cube__: XX, YY, ZZ, C must be of equal size
error: called from:
error:   /usr/share/octave/3.6.2/m/plot/private/__marching_cube__.m at line 107, column 5
error:   /usr/share/octave/3.6.2/m/plot/isosurface.m at line 157, column 32
octave:45> size(x)
ans =

   10    5    5

octave:46> size(val)
ans =

    5   10    5


while next code is Ok;


octave:47> [x, y, z] = meshgrid (1:5, 1:5, 1:10);
octave:48> val = rand (5, 5, 10);
octave:49> isosurface (x, y, z, val, .5);
octave:50> size(x)
ans =

    5    5   10

octave:51> size(val)
ans =

    5    5   10

octave:52>


This is probably really minor, but annoying and could bring errors somewhere else... Thank you!

Anonymous

 

(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 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-20 rik5 StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-05-02 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code