comparison scripts/plot/trisurf.m @ 14247:c4fa5e0b6193

test: Make surface demos reproducible by setting colormap to default at start of demo. * bicubic.m, interp2.m, interpn.m, griddata.m, image.m, axis.m, clabel.m, colorbar.m, contour.m, contourf.m, cylinder.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezsurf.m, ezsurfc.m, hold.m, pcolor.m, plotyy.m, quiver3.m, ribbon.m, shading.m, slice.m, sombrero.m, surf.m, surfc.m, surfnorm.m, trisurf.m: Set colormap to default at start of demos to make them reproducible.
author Rik <octave@nomad.inbox5.com>
date Sun, 22 Jan 2012 10:02:27 -0800
parents 4506eade9f04
children 460a3c6d8bf1
comparison
equal deleted inserted replaced
14246:8b220af26cfb 14247:c4fa5e0b6193
72 endfunction 72 endfunction
73 73
74 74
75 %!demo 75 %!demo
76 %! clf; 76 %! clf;
77 %! colormap ('default');
77 %! N = 31; 78 %! N = 31;
78 %! [x, y] = meshgrid (1:N); 79 %! [x, y] = meshgrid (1:N);
79 %! tri = delaunay (x, y); 80 %! tri = delaunay (x, y);
80 %! z = peaks (N); 81 %! z = peaks (N);
81 %! h = trisurf (tri, x, y, z, 'facecolor', 'interp'); 82 %! h = trisurf (tri, x, y, z, 'facecolor', 'interp');
83 %! zlim auto; 84 %! zlim auto;
84 %! title (sprintf ('facecolor = %s', get (h, 'facecolor'))); 85 %! title (sprintf ('facecolor = %s', get (h, 'facecolor')));
85 86
86 %!demo 87 %!demo
87 %! clf; 88 %! clf;
89 %! colormap ('default');
88 %! N = 31; 90 %! N = 31;
89 %! [x, y] = meshgrid (1:N); 91 %! [x, y] = meshgrid (1:N);
90 %! tri = delaunay (x, y); 92 %! tri = delaunay (x, y);
91 %! z = peaks (N); 93 %! z = peaks (N);
92 %! h = trisurf (tri, x, y, z, 'facecolor', 'flat'); 94 %! h = trisurf (tri, x, y, z, 'facecolor', 'flat');
94 %! zlim auto; 96 %! zlim auto;
95 %! title (sprintf ('facecolor = %s', get (h, 'facecolor'))); 97 %! title (sprintf ('facecolor = %s', get (h, 'facecolor')));
96 98
97 %!demo 99 %!demo
98 %! clf; 100 %! clf;
101 %! colormap ('default');
99 %! old_state = rand ('state'); 102 %! old_state = rand ('state');
100 %! restore_state = onCleanup (@() rand ('state', old_state)); 103 %! restore_state = onCleanup (@() rand ('state', old_state));
101 %! rand ('state', 10); 104 %! rand ('state', 10);
102 %! N = 10; 105 %! N = 10;
103 %! x = 3 - 6 * rand (N, N); 106 %! x = 3 - 6 * rand (N, N);
106 %! tri = delaunay (x(:), y(:)); 109 %! tri = delaunay (x(:), y(:));
107 %! trisurf (tri, x(:), y(:), z(:)); 110 %! trisurf (tri, x(:), y(:), z(:));
108 111
109 %!demo 112 %!demo
110 %! clf; 113 %! clf;
114 %! colormap ('default');
111 %! x = rand (100, 1); 115 %! x = rand (100, 1);
112 %! y = rand (100, 1); 116 %! y = rand (100, 1);
113 %! z = x.^2 + y.^2; 117 %! z = x.^2 + y.^2;
114 %! tri = delaunay (x, y); 118 %! tri = delaunay (x, y);
115 %! trisurf (tri, x, y, z); 119 %! trisurf (tri, x, y, z);
116 120
117 %!demo 121 %!demo
118 %! clf; 122 %! clf;
123 %! colormap ('default');
119 %! x = rand (100, 1); 124 %! x = rand (100, 1);
120 %! y = rand (100, 1); 125 %! y = rand (100, 1);
121 %! z = x.^2 + y.^2; 126 %! z = x.^2 + y.^2;
122 %! tri = delaunay (x, y); 127 %! tri = delaunay (x, y);
123 %! trisurf (tri, x, y, z, 'facecolor', 'interp'); 128 %! trisurf (tri, x, y, z, 'facecolor', 'interp');
124 129
125 %!demo 130 %!demo
126 %! clf; 131 %! clf;
132 %! colormap ('default');
127 %! x = rand (100, 1); 133 %! x = rand (100, 1);
128 %! y = rand (100, 1); 134 %! y = rand (100, 1);
129 %! z = x.^2 + y.^2; 135 %! z = x.^2 + y.^2;
130 %! tri = delaunay (x, y); 136 %! tri = delaunay (x, y);
131 %! trisurf (tri, x, y, z, 'facecolor', 'interp', 'edgecolor', 'k'); 137 %! trisurf (tri, x, y, z, 'facecolor', 'interp', 'edgecolor', 'k');