Plotting problem again

Ben Abbott bpabbott at mac.com
Wed Jun 11 18:11:26 CDT 2008


On Jun 11, 2008, at 4:02 PM, John W. Eaton wrote:

> On  3-Jun-2008, Ben Abbott wrote:
>
> | On Jun 1, 2008, at 1:45 PM, Ben Abbott wrote:
> |
> | > At present, I see 3 topics/bugs/features to discuss
> | >
> | > (1) Is there a bug respecting "If all arguments are matrices, then
> | > each column of the matrices is treated as a separate line"?
> | > (2) Is there a bug respecting the specification of linestype/ 
> color/
> | > marker?
> | > (3) Shall mixing of x/y vectors in combination with a z array be
> | > supported?
> |
> | A fourth item is merited.
> |
> | (4) Matlab does not support plot3(x, y + 1i*z) as equivalent to
> | plot3(x, y, z). While useful. this Octave feature makes  
> compatibility
> | with Matlab difficult.
>
> Why does Octave's plot3 have this special feature?
>
> | It would appear a significant rewrite of plot3 is merited. What is  
> the
> | preference? ... shall the corrected version attempt to be backward
> | compatible *and* respect Matlab, or it is sufficient to respect
> | Matlab's plot3?
>
> If it is possible to keep backward compatibility without too much
> effort, then I'd say do it.  Otherwise, I think compatibility is
> generally more important (unless the compatible behavior is really
> undesirable or could be considered a bug).
>
> Please note that I dropped the help list from this reply.  I don't
> think it is necessary to cross post this discussion.
>
> jwe

Regarding the features which extend beyond what is currently in  
Octave, I'm inclined to drop them since I don't see how it is possible  
ensure proper interpretation of the inputs.

Limiting Octave's functionality to Matlab's means that the following  
must be supported

------------------------------
plot3(X1,Y1,Z1,...), where X1, Y1, Z1 are vectors or matrices, plots  
one or more lines in three-dimensional space through the points whose  
coordinates are the elements of X1, Y1, and Z1.

plot3(X1,Y1,Z1,LineSpec,...) creates and displays all lines defined by  
the Xn,Yn,Zn,LineSpec quads, where LineSpec is a line specification  
that determines line style, marker symbol, and color of the plotted  
lines.

plot3(...,'PropertyName',PropertyValue,...) sets properties to the  
specified property values for all Line graphics objects created by  
plot3.
------------------------------

... and unless I've missed something Octave's plot3 is presently  
compatible.

This thread began with the desire that if (x,y) were 1-D vectors and z  
were 2-D, meshgrid could be applied to resolve the problem with x, y,  
& z having different sizes. Matlab supports that syntax so that bug  
should be submitted as a changeset.

The only remaining issue is the way 2-D arrays are handled. The  
instructions below produce 11 lines in 3-D space in Matlab. However,  
in Octave 1 zigzag line is produced.

	> [x, y] = meshgrid (0:10, 0:10);
	> z = x.*y;
	> plot3 (x, y, z)

I took a quick look but quickly found the solution is a bit deeper  
than I'd expected (I'm unfamiliar the details of how Octave handles  
plotting lines).

I don't have the time to dig into this at the moment, but am willing  
to do so when time permits ... if someone else is up to taking this on  
let me know.

Ben









More information about the Bug-octave mailing list