diff scripts/plot/contour.m @ 13156:da71f676e449 stable

Fix bug #34282. Fill holes in contours with the background colour * scripts/plot/private/__contour__.m: Properly fill holes in contours. * scripts/plot/contour.m: Add demo.
author Ben Abbott <bpabbott@mac.com>
date Sun, 18 Sep 2011 15:55:54 -0400
parents c792872f8942
children 72c96de7a403
line wrap: on
line diff
--- a/scripts/plot/contour.m
+++ b/scripts/plot/contour.m
@@ -71,11 +71,22 @@
 endfunction
 
 %!demo
+%! clf ()
 %! [x, y, z] = peaks ();
 %! contour (x, y, z);
 
 %!demo
+%! clf ()
 %! [theta, r] = meshgrid (linspace (0, 2*pi, 64), linspace(0,1,64));
 %! [X, Y] = pol2cart (theta, r);
 %! Z = sin(2*theta).*(1-r);
 %! contour(X, Y, abs(Z), 10)
+
+%!demo
+%! clf ()
+%! x = linspace (-2, 2);
+%! [x, y] = meshgrid (x);
+%! z = sqrt (x.^2 + y.^2) ./ (x.^2 + y.^2+1);
+%! contourf (x, y, z, [0.4, 0.4])
+%! title ("The hole should be filled with the background color")
+