[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plotting problem again
From: |
Ben Abbott |
Subject: |
Re: Plotting problem again |
Date: |
Sun, 01 Jun 2008 13:45:38 -0400 |
On Jun 1, 2008, at 12:44 PM, Ben Abbott wrote:
On Jun 1, 2008, at 8:07 AM, Thomas Weber wrote:
On 01/06/08 03:58 -0700, asha g wrote:
I am plotting the same data as before vvvv is a fn of x and y.
size(vvvv) = 10 10
length(x) = 10
length(y) = 10
When I give a plot3(x,y,vvvv) command I get the following error:
ans =
10 10
error: plot3: [length(x), length(y)] must match size(z)
error: evaluating if command near line 159, column 2
error: evaluating if command near line 158, column 7
error: evaluating if command near line 113, column 5
error: evaluating while command near line 103, column 3
error: called from `plot3' in file `/usr/local/share/octave/3.0.0/m/
plot/plot3.m'
error: near line 109 of file `/home/proj/08/cesasha/aseasha/
cabunbactoct.
[cc'ing bugs, this looks like a bug]
I think the order of the elseif and else branches should be reverted,
see attached patch. No hg changeset, as I want to discuss this first.
Thomas
I'll take a quick look at your patch ... it does look like you've
found the problem. I'll do some tests to confirm.
Speaking of tests, who might test scripts be properly included in such
cases? May be assume a graphics backend is alive and well during "make
check".
Ben
From the prior emails, I inferred Asha is trying to do something like
this ...
octave:39> x = 0:10;
octave:40> y = 0:10;
octave:41> [xg, yg] = meshgrid (x, y);
octave:42> z = xg + yg;
octave:43> plot3a (x, y, z)
octave:44> whos x y z
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
x 1x11 24 double
y 1x11 24 double
z 11x11 968 double
Total is 143 elements using 1016 bytes
Thomas' patch does produce a plot, but not quite the one *I*
expected :-(
I had expected to see 11 lines plotted in 3-D space ... like plot(x,z)
would produce in 2-D. Instead I get 1 zig-zag line. This appears to be
in conflict with the documentation; "If all arguments are matrices,
then each column of the matrices is treated as a separate line."
In any event, when using Thomas' patch I encounter an error with the
linetype/color/marker is specified. For example,
octave:45> plot3a (x, y, z, 'r')
error: plot3: [length(x), length(y)] must match size(z)
error: evaluating if command near line 162, column 2
error: evaluating if command near line 161, column 7
error: evaluating if command near line 116, column 5
error: evaluating while command near line 106, column 3
error: called from `plot3a' in file `/Users/bpabbott/Development/
Octave Toolbox/plot3/plot3a.m'
octave:45>
This led me to check the documentation for plot3 more closely. I don't
see where either Octave or Matlab's documentation suggests the
behavior I've inferred is supported (i.e. x and y being vectors and z
being a 2D array). It appears that x, y, & z must each be vectors or
each be arrays. Meaning that they are not expected to be mixed. Can
someone confirm?
However, Matlab's documentation does indicate that each line may be
accompanied by a 1-3 character string defining the color, linestyle,
and/or marker.
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?
Ben
Re: Plotting problem again, Doug Stewart, 2008/06/01