bugGNU Octave - Bugs: bug #65984, plot3 cant plot when x and y...

 
 

bug #65984: plot3 cant plot when x and y dimensions are not the same

Submitter:  None
Submitted:  Sat 13 Jul 2024 08:07:31 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.1.0
Release:  Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 24 Jul 2024 12:01:47 AM UTC, comment #4: 

The error message is correct.  X, Y, and Z either need to have the same dimensions or some of the inputs can be vectors as long as the length of the vector matches one of the dimensions of the 2-D input.  Specifically, this code is incorrect


x = linspace(-10, 10, 4);
y = linspace(-10, 10, 3);


as the x-vector has 4 points but the y-vector only has 3 points.

Closing report.

Rik <rik5>
Group administrator
Sat 13 Jul 2024 08:16:01 AM UTC, comment #3: 

the z matrices are correctly formatted in the last comment, please use that code

Anonymous
Sat 13 Jul 2024 08:13:59 AM UTC, comment #2: 

% the z matrices are still formatted wrong by this webpage, i try % again




x = linspace(-10, 10, 3);
y = linspace(-10, 10, 3);

z=[0 0 0; 0 1 0; 0 0 0];

plot3(x,y,z, '.', 'MarkerSize', 20);%works


figure

x = linspace(-10, 10, 4);
y = linspace(-10, 10, 3);

z=[0 0 0 0; 0 1 0 0; 0 0 0 0];

plot3(y,x,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: X, Y, and Z must have the same shape



%plot3(x,y,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: [length(X), length(Y)] must match size (Z)


%this works:
%mesh(x, y, z, "facecolor", "none");

Anonymous
Sat 13 Jul 2024 08:11:48 AM UTC, comment #1: 

%the z matrices are formatted wrong by this webpage, i try again




x = linspace(-10, 10, 3);
y = linspace(-10, 10, 3);

z=[0 0 0;...

  1. 1 0;...
  2. 0 0];


plot3(x,y,z, '.', 'MarkerSize', 20);%works


figure

x = linspace(-10, 10, 4);
y = linspace(-10, 10, 3);

z=[0 0 0 0;...

  1. 1 0 0;...
  2. 0 0 0];


plot3(y,x,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: X, Y, and Z must have the same shape



%plot3(x,y,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: [length(X), length(Y)] must match size (Z)


%this works:
%mesh(x, y, z, "facecolor", "none");

Anonymous
Sat 13 Jul 2024 08:07:31 AM UTC, original submission:  

x = linspace(-10, 10, 3);
y = linspace(-10, 10, 3);

z=[0 0 0;

  1. 1 0;
  2. 0 0];


plot3(x,y,z, '.', 'MarkerSize', 20);%works


figure

x = linspace(-10, 10, 4);
y = linspace(-10, 10, 3);

z=[0 0 0 0;

  1. 1 0 0;
  2. 0 0 0];


plot3(y,x,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: X, Y, and Z must have the same shape



%plot3(x,y,z, '.', 'MarkerSize', 20);
%this gives:
%error: plot3: [length(X), length(Y)] must match size (Z)


%this works:
%mesh(x, y, z, "facecolor", "none");




%thanks for your work on Octave, it is very good software.

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

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-24 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.14-7003.
    Corresponding source code