bugGNU Octave - Bugs: bug #35271, plot3 for x,y,z from meshgrid is...

 
 

bug #35271: plot3 for x,y,z from meshgrid is incorrect

Submitter:  None
Submitted:  Mon 09 Jan 2012 10:29:50 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.3
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Jan 2012 01:34:10 AM UTC, comment #5: 
Ben Abbott <bpabbott>
Group Member
Tue 10 Jan 2012 01:25:48 AM UTC, comment #4: 

You have a typo, "more the two", but otherwise seems fine to me.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Tue 10 Jan 2012 12:44:01 AM UTC, comment #3: 

I've attached a changeset (first attempt)

Ben Abbott <bpabbott>
Group Member
Mon 09 Jan 2012 11:39:08 PM UTC, comment #2: 

I checked Matlab R2011b


Error using plot3
Data may not have more than 2 dimensions


I don't have a particular preference. Should we be error compatible with ML, or might Octave convert ND arrays to 2D in this case?


reshape2d = @(x) reshape (x, [size(x,1), prod(size(x)(2:end))]);
xi = reshape2d (xi);
yi = reshape2d (yi);
zi = reshape2d (zi);



Ben Abbott <bpabbott>
Group Member
Mon 09 Jan 2012 10:51:28 PM UTC, comment #1: 

I don't understand. What was the output you expected? plot3 isn't suppsed to work with higher-dimensional arrays.

I suppose the problem here is that plot3 didn't error out as it should have?

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 09 Jan 2012 10:29:50 PM UTC, original submission:  

x=[1,2,3,4,5,6,7,8,1,2];
y=[2,4,1,2,7,8,6,4,2,1];
z=[7,6,1,8,4,2,8,9,2,0];

dxx=linspace(min(x),max(x),50);
dyy=linspace(min(y),max(y),50);
dzz=linspace(min(z),max(z),50);

[xi,yi,zi]=meshgrid(dxx,dyy,dzz);

plot3(xi,yi,zi)

% PLOTS ALL "z" as 0!!

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #24792:  changeset.patch added by bpabbott (1KiB - application/octet-stream - first attempt)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-10 bpabbott StatusConfirmed Fixed
        Assigned toNone bpabbott
        Open/ClosedOpen Closed
    2012-01-10 bpabbott Attached File- Added changeset.patch, #24792
    2012-01-09 bpabbott StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code