diff scripts/plot/contour.m @ 17525:76a6d7de4cbc

Fix multiple problem with listeners for contour groups. * scripts/plot/contour.m: Add new %!demo showing use of a single contour line. * scripts/plot/private/__contour__.m: Fix bug with lowest level of contourf showing background through. Use same routines for calculating levels and levelstep in main code and in listeners. Fix linecolor when turning "fill" on and off. Fix "textlist" and "textliststep" properties which were not activating correctly.
author Rik <rik@octave.org>
date Tue, 01 Oct 2013 12:51:04 -0700
parents 68bcac3c043a
children
line wrap: on
line diff
--- a/scripts/plot/contour.m
+++ b/scripts/plot/contour.m
@@ -90,7 +90,6 @@
 %! colormap ('default');
 %! [x, y, z] = peaks ();
 %! contour (x, y, z);
-%! title ('contour() plot of peaks() function');
 %! title ({'contour() plot (isolines of constant Z)'; 'Z = peaks()'});
 
 %!demo
@@ -102,13 +101,20 @@
 %! contour (X, Y, abs (Z), 10);
 %! title ({'contour() plot'; 'polar fcn: Z = sin (2*theta) * (1-r)'});
 
+%!demo
+%! clf;
+%! colormap ('default');
+%! z = peaks ();
+%! contour (z, [0 0]);
+%! title ({'contour() plot with single isoline at Z == 0'; 'Z = peaks()'});
+
 %!test
 %! hf = figure ("visible", "off");
 %! clf (hf);
 %! unwind_protect
 %!   [x, y, z] = peaks ();
 %!   [c, h] = contour (x, y, z);
-%!   levellist = (-6):6;
+%!   levellist = -6:6;
 %!   set (h, "levellist", levellist);
 %!   assert (get (h, "levellist"), levellist)
 %!   assert (get (h, "levellistmode"), "manual")
@@ -126,7 +132,7 @@
 %!   set (h, "levelstep", levelstep);
 %!   assert (get (h, "levelstep"), levelstep)
 %!   assert (get (h, "levelstepmode"), "manual")
-%!   assert (get (h, "levellist"), (-6):levelstep:6)
+%!   assert (get (h, "levellist"), -6:levelstep:6)
 %!   assert (get (h, "levellistmode"), "auto")
 %! unwind_protect_cleanup
 %!   close (hf);