Bug 89704 - Choice of levels in contour plot is impossible
Summary: Choice of levels in contour plot is impossible
Keywords:
Status: CLOSED DUPLICATE of bug 89705
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: octave
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Lon Hohberger
QA Contact:
URL: http://www.octave.org/mailing-lists/h...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-26 10:54 UTC by Niels L Ellegaard
Modified: 2007-04-18 16:53 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-04-28 16:49:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Niels L Ellegaard 2003-04-26 10:54:35 UTC
Description of problem:


Version-Release number of selected component (if applicable):
GNU Octave, version 2.1.36
(Solved in later versions of Octave)

How reproducible:
100%

Steps to Reproduce:
octave:1> x = y = [0:0.01:2];
octave:2> z = sin(x' * y);
octave:3> contour(x,y,z,[1:1:15])
    
Actual results:
Only 10 contour lines appear

Expected results:
15 contour lines appear

Additional info:
When I try to make a contour plot I cannot make more than 10 levels. I
have been looking in the code and I think that the problem occurs because
of a maximum string length. In order to prove this, I copied contour.m to
my home directory and removed two semicolons. Afterwards line 88 - 96
looked like this:

if (is_scalar (n))
 command = sprintf ("gset cntrparam levels %d", n);
elseif (is_vector (n))
tmp = sprintf ("%f", n(1));
for i = 2:length (n)
 tmp = sprintf ("%s, %f", tmp, n(i))  # colon is removed
endfor
 command = sprintf ("gset cntrparam levels discrete %s", tmp) # same here
endif

I tried the following

octave:1> x = y = [0:0.01:2];
octave:2> z = sin(x' * y);
octave:3> contour(x,y,z,[1:1:15])

The resulting plot contained only levels 1:10. Here is the output. Note 
that for i>10, I got tmp = 1:10,N.

tmp = 1.000000, 2.000000
tmp = 1.000000, 2.000000, 3.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000, 8.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000, 11.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000, 12.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000, 13.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000, 14.000000
tmp = 1.000000, 2.000000, 3.000000, 4.000000, 5.000000, 6.000000, 7.000000,
8.000000, 9.000000, 10.000000, 15.000000
command = gset cntrparam levels discrete 1.000000, 2.000000, 3.000000, 4.000000,
5.000000, 6.000000, 7.000000, 8.000000, 9.000000, 10.000000

Comment 1 Lon Hohberger 2003-04-28 15:27:35 UTC

*** This bug has been marked as a duplicate of 89705 ***


Note You need to log in before you can comment on or make changes to this bug.