bugGNU Octave - Bugs: bug #34282, Holes in countours don't get...

 
 

bug #34282: Holes in countours don't get background color (FLTK)

Submitter:  None
Submitted:  Tue 13 Sep 2011 11:27:04 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  None
Originator Name:  Anders Höglund Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 18 Sep 2011 08:16:50 PM UTC, comment #1: 

I've pushed a modified change and added a demo.

http://hg.savannah.gnu.org/hgweb/octave/rev/da71f676e449

Ben Abbott <bpabbott>
Group Member
Tue 13 Sep 2011 11:27:04 AM UTC, original submission:  

The below code should produce a (green) filled disc with a hole in the centre.  On version 3.4.2 the whole in the centre is a third colour (dark red) instead of the background colour (white).


x = linspace(-2,2);
[X,Y] = meshgrid(x);
contourf(x,x,sqrt(X.^2+Y.^2)./(X.^2+Y.^2+1) ,[0.4,0.4] )


The following patch to _contour_.m appears to fix the problem for me.


--- /usr/share/octave/3.4.2/m/plot/private/__contour__.m        2011-08-12 15:46:16.000000000 +0200
+++ __contour__.m       2011-09-13 12:09:37.372008000 +0200
@@ -319,10 +319,15 @@
       else
         ## Special case unclosed contours
       endif
+      if (isnan(cont_lev(idx)))
+        fc = [1, 1, 1];
+      else
+        fc = "flat";
+      endif
       h = [h; __go_patch__(ca, "xdata", ctmp(1, :)(:), "ydata", ctmp(2, :)(:),
                            "vertices", ctmp.', "faces", 1:(cont_len(idx)-1),
                            "facevertexcdata", cont_lev(idx),
-                           "facecolor", "flat", "cdata", cont_lev(idx),
+                           "facecolor", fc, "cdata", cont_lev(idx),
                            "edgecolor", lc, "linestyle", ls,
                            "linewidth", lw, "parent", hg)];
     endfor


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-18 bpabbott Open/ClosedOpen Closed
    2011-09-18 bpabbott CategoryPlotting Plotting with OpenGL
        SummaryHoles in filled countours don\'t get the background colour Holes in countours don't get background color (FLTK)

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code