octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #40114] pcolor with NaN produces black grid ce


From: anonymous
Subject: [Octave-bug-tracker] [bug #40114] pcolor with NaN produces black grid cells and invalid EPS files
Date: Thu, 26 Sep 2013 19:45:25 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

URL:
  <http://savannah.gnu.org/bugs/?40114>

                 Summary: pcolor with NaN produces black grid cells and
invalid EPS files
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 26 Sep 2013 07:45:25 PM UTC
                Category: Plotting with OpenGL
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Alexander Barth
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:


If a matrix containing a NaN is plotted with pcolor, the corresponding grid
cell is black, while in matlab such elements are not plotted (they appear
white since the default background is white).

If the plot is saved as an EPS file, the resulting file containts a "nan" and
cannot be opened by ghostscript (which is used to create a PNG file for
example).

The following command 

 pcolor([NaN 1 2; 3 4 5; 6 7 8])
 print -dpng test.png

creates thus an error:

Error: /undefined in nan
Operand stack:
   --nostringval--   74.88   223.56
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop  
1909   1   3   %oparray_pop   --nostringval--   1893   1   3   %oparray_pop  
1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
--nostringval--
Dictionary stack:
   --dict:1167/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--  
--dict:40/64(L)--
Current allocation mode is local
GPL Ghostscript 9.05: Unrecoverable error, exit code 1


I got this error for the current development version (changeset:
17497:96cf8ee3440e) and octave 3.6.4.

The special value "NA" produces the same error, but not Inf.

The code in gl-render.cc (function opengl_renderer::draw_surface)  checks only
if the grid arrays x,y or z contain a NaN. The attached patch adds additional
checks. I have tested it with NaN and NA for flat and interpolated shading.








    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 26 Sep 2013 07:45:25 PM UTC  Name: pcolor_NaN.patch  Size: 1kB   By:
None

<http://savannah.gnu.org/bugs/download.php?file_id=29232>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40114>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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