[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #32275] "surf" function incorrectly handles Na

From: D Walker
Subject: [Octave-bug-tracker] [bug #32275] "surf" function incorrectly handles NaN in colour data
Date: Mon, 31 Jan 2011 10:42:35 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv: Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13

Follow-up Comment #1, bug #32275 (project octave):

This seems to have not included my Test Case.

The surf (and surface, and pcolor) functions do not handle NaN values the
same as Matlab.

The following commands:

> c = [1 1.5 -1 0.2 2; 2 1.8 1.2 0.4 -0.8;1.6 NaN 0.7 2 -2;-1.1 1.5 0.1 -0.7
> [nr, nc] = size(c);
> [x, y] = meshgrid (1:nc, 1:nr);
> surf(x,y,zeros(size(x)),c)

produces octave_surf_nan_bug.png in octave and matlab_surf_nan_bug.png  in
Matlab; i.e. octave treats NaNs as zero. You can issue:

> surf(zeros(size(c))+(c-c),c)

in octave, which produces octave_surf_bug_2.png; (the "+(c-c)" places
matching NaNs in the zeroes matrix) but some of the surrounding cells are also
left blank in that case.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]