changeset 8790:a013ff655ca4

Trivial changes to demos to produce a more pleasant output for octave+gnuplot+aquaterm.
author Ben Abbott <bpabbott@mac.com>
date Wed, 18 Feb 2009 00:46:24 -0500
parents d9bff42fec43
children d943e26d30e2
files scripts/ChangeLog scripts/plot/clabel.m scripts/plot/colorbar.m scripts/plot/comet.m scripts/plot/contourc.m scripts/plot/fill.m scripts/plot/legend.m scripts/plot/pareto.m scripts/plot/patch.m scripts/plot/plotyy.m scripts/plot/surfnorm.m
diffstat 11 files changed, 53 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,4 +1,13 @@
-2009-02-17  Ben Abbott <bpabbott@mac.com>
+2009-02-17  Ben Abbott  <bpabbott@mac.com>
+
+	* plot/contourc.m: Convert demo to test.
+	* plot/surfnorm.m: Add another demo.
+	* plot/surfnorm.m, plot/pareto.m: Add "colormap(jet)" to 1st demo.
+	* plot/plotyy.m, plot/patch.m, plot/pareto.m, plot/legend.m,
+	plot/fill.m, plot/comet.m, plot/colorbar.m, plot/clabel.m:
+	Replace "close all" with "clf" in demo.
+
+2009-02-17  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/gnuplot_drawnow.m: Only close the gnuplot window and send
 	position/size info when the figure's position property has changed.
@@ -18,7 +27,7 @@
 	* help/__strip_html_tags__.m, help/__additional_help_message__.m:
 	Doc fix.
 
-2009-02-16  Ben Abbott <bpabbott@mac.com>
+2009-02-16  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/shading.m: No new figure windows for the demos.
 	* plot/surfl.m: Clear figure before running demos.
@@ -58,11 +67,11 @@
 	New functions.
 	* deprecated/Makefile.in (SOURCES): Add them to the list.
 
-2009-02-15  Ben Abbott <bpabbott@mac.com>
+2009-02-15  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/subplot.m: Compatible placement of subplots.
 
-2009-02-13 Ben Abbott <bpabott@mac.com>
+2009-02-13 Ben Abbott  <bpabott@mac.com>
 
 	* plot/__go_draw_axes__.m: Respect axes ticklength property.
 
@@ -230,7 +239,7 @@
         * plot/Makefile.in (SOURCES): Include diffuse.m, specular.m, and
 	surfl.m in the list.
 
-2009-01-28  Ben Abbott <bpabbott@mac.com>
+2009-01-28  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/gnuplot_drawnow.m: Style fixes.
 
@@ -309,11 +318,11 @@
 	first step. Simplify options. Adjust defaults - make TR radius
 	tolerance less stringent. Support DisplayFcn.
 
-2008-12-24 Ben Abbott <bpabbott@mac.com>
+2008-12-24 Ben Abbott  <bpabbott@mac.com>
 
 	* path/savepath.m: Respect cmd-line and env paths.
 
-2009-01-24 Ben Abbott <bpabbott@mac.com>
+2009-01-24 Ben Abbott  <bpabbott@mac.com>
 
 	* sparse/svds.m: svds.m: skip tests if ARPACK is missing.
 
@@ -386,7 +395,7 @@
 
 	* testfun/assert.m: Use isfield instead of struct_contains.
 
-2009-01-17 Ben Abbott <bpabbott@mac.com>
+2009-01-17 Ben Abbott  <bpabbott@mac.com>
 
 	* general/cart2sph.m, cart2pol.m, sph2cart.m pol2cart.m:
 	Permit scalars when transforming coordinates.
@@ -575,11 +584,11 @@
 	* plot/hist.m: Doc string now mentions matrix input argument.
 	Correct error message.
 
-2008-12-30  Ben Abbott <bpabbott@mac.com>
+2008-12-30  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/__contour__.m: __contour__.m: correct order of patches
 
-2008-12-30  Ben Abbott <bpabbott@mac.com>
+2008-12-30  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/__contour__.m: __contour__.m: correct order of patches
 
@@ -667,11 +676,11 @@
           miscellaneous/__xzip__.m: Improve error messages, fix cleanup
           of temporary directories, remove tab characters
 
-2008-11-24  Ben Abbott <bpabbott@mac.com>
+2008-11-24  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/legend.m: Correct ording of legend labels.
 
-2008-11-24  Ben Abbott <bpabbott@mac.com>
+2008-11-24  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/__go_draw_axes__.m: Correct order for rendering children.
 
@@ -685,7 +694,7 @@
 	* plot/__go_draw_axes__.m (do_tics_1): Support the minorick properties
 	of the axis object.
 
-2008-11-14  Ben Abbott <bpabbott@mac.com>
+2008-11-14  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/gnuplot_drawnow.m: Add support of properites to gp backend.
 
@@ -719,7 +728,7 @@
         * miscellaneous/unpack.m: return directly after recursive handling
           of cell-strings
           
-2008-11-03  Ben Abbott <bpabbott@mac.com>
+2008-11-03  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/__go_draw_axes__.m: xticklabel should accept a numeric vector.
 
@@ -810,7 +819,7 @@
 
 	* plot/ellipsoid.m: Check nargin == 6, not nargin == 5.
 
-2008-10-22  Ben Abbott <bpabbott@mac.com>
+2008-10-22  Ben Abbott  <bpabbott@mac.com>
 
 	* plot/cla.m: Fix error when no children to clear.
 
--- a/scripts/plot/clabel.m
+++ b/scripts/plot/clabel.m
@@ -129,11 +129,11 @@
 endfunction
 
 %!demo
-%! close all
+%! clf
 %! [c, h] = contour (peaks(), -4 : 6);
 %! clabel (c, h, -4 : 2 : 6, 'fontsize', 12);
 
 %!demo
-%! close all
+%! clf
 %! [c, h] = contourf (peaks(), -7 : 6);
 %! clabel (c, h, -6 : 2 : 6, 'fontsize', 12);
--- a/scripts/plot/colorbar.m
+++ b/scripts/plot/colorbar.m
@@ -345,7 +345,7 @@
 
 %!demo
 %! hold off;
-%! close all;
+%! clf
 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); 
 %! imagesc(x)
 %! colorbar();
--- a/scripts/plot/comet.m
+++ b/scripts/plot/comet.m
@@ -80,7 +80,7 @@
 endfunction
 
 %!demo
-%! close all;
+%! clf
 %! t = 0:.1:2*pi;
 %! x = cos(2*t).*(cos(t).^2);
 %! y = sin(2*t).*(sin(t).^2);
--- a/scripts/plot/contourc.m
+++ b/scripts/plot/contourc.m
@@ -134,8 +134,14 @@
 
 endfunction
 
-%!demo
+%!test
 %! x = 0:2;
 %! y = x;
 %! z = x' * y;
-%! contourc (x, y, z, 2:3)
+%! [c_actual, lev_actual]= contourc (x, y, z, 2:3);
+%! c_expected = [2, 1, 1, 2, 2, 3, 1.5, 2; 4, 2, 2, 1, 1, 2, 2, 1.5];
+%! lev_expected = [2 3];
+%! assert (c_actual, c_expected, eps)
+%! assert (lev_actual, lev_expected, eps)
+
+
--- a/scripts/plot/fill.m
+++ b/scripts/plot/fill.m
@@ -108,7 +108,7 @@
 endfunction
 
 %!demo
-%! close all;
+%! clf
 %! t1 = (1/16:1/8:1)'*2*pi;
 %! t2 = ((1/16:1/8:1)' + 1/32)*2*pi;
 %! x1 = sin(t1) - 0.8;
--- a/scripts/plot/legend.m
+++ b/scripts/plot/legend.m
@@ -228,19 +228,19 @@
 endfunction
 
 %!demo
-%! close all;
+%! clf
 %! plot(1:10, 1:10, 1:10, fliplr(1:10));
 %! title("incline is blue and decline is green");
 %! legend({"I'm blue", "I'm green"}, "location", "east")
 
 %!demo
-%! close all;
+%! clf
 %! plot(1:10, 1:10);
 %! title("a very long label can sometimes cause problems");
 %! legend({"hello world"}, "location", "northeastoutside")
 
 %!demo
-%! close all;
+%! clf
 %! labels = {};
 %! for i = 1:5
 %!     plot(1:100, i + rand(100,1)); hold on;
--- a/scripts/plot/pareto.m
+++ b/scripts/plot/pareto.m
@@ -100,13 +100,14 @@
 endfunction
 
 %!demo
-%! close
+%! clf
+%! colormap (jet (64))
 %! Cheese = {"Cheddar", "Swiss", "Camembert", "Munster", "Stilton", "Blue"};
 %! Sold = [105, 30, 70, 10, 15, 20];
 %! pareto(Sold, Cheese);
 
 %!demo
-%! close
+%! clf
 %! % Suppose that we want establish which products makes 80 % of turnover.
 %! Codes = {"AB4","BD7","CF8","CC5","AD11","BB5","BB3","AD8","DF3","DE7"};
 %! Value = [2.35 7.9 2.45 1.1 0.15 13.45 5.4 2.05 0.85  1.65]';
--- a/scripts/plot/patch.m
+++ b/scripts/plot/patch.m
@@ -59,7 +59,7 @@
 
 %!demo
 %! ## Patches with same number of vertices
-%! close all;
+%! clf
 %! t1 = (1/16:1/8:1)'*2*pi;
 %! t2 = ((1/16:1/8:1)' + 1/32)*2*pi;
 %! x1 = sin(t1) - 0.8;
@@ -70,7 +70,7 @@
 
 %!demo
 %! ## Unclosed patch
-%! close all;
+%! clf
 %! t1 = (1/16:1/8:1)'*2*pi;
 %! t2 = ((1/16:1/16:1)' + 1/32)*2*pi;
 %! x1 = sin(t1) - 0.8;
@@ -81,7 +81,7 @@
 
 %!demo
 %! ## Specify vertices and faces separately
-%! close all;
+%! clf
 %! t1 = (1/16:1/8:1)'*2*pi;
 %! t2 = ((1/16:1/16:1)' + 1/32)*2*pi;
 %! x1 = sin(t1) - 0.8;
@@ -94,7 +94,7 @@
 
 %!demo
 %! ## Property change on multiple patches
-%! close all;
+%! clf
 %! t1 = (1/16:1/8:1)'*2*pi;
 %! t2 = ((1/16:1/8:1)' + 1/32)*2*pi;
 %! x1 = sin(t1) - 0.8;
--- a/scripts/plot/plotyy.m
+++ b/scripts/plot/plotyy.m
@@ -185,7 +185,7 @@
 endfunction
 
 %!demo
-%! close all;
+%! clf
 %! x = 0:0.1:2*pi; 
 %! y1 = sin (x);
 %! y2 = exp (x - 1);
--- a/scripts/plot/surfnorm.m
+++ b/scripts/plot/surfnorm.m
@@ -136,8 +136,13 @@
 endfunction
 
 %!demo
+%! colormap (jet (64))
 %! [x, y, z] = peaks(10);
 %! surfnorm (x, y, z);
 
 %!demo
 %! surfnorm (peaks(10));
+
+%!demo
+%! surfnorm (peaks(32));
+%! shading interp