Milkdrop : Rewrite demo to avoid deprecated function use. 15/14215/2
Bruno JOFRET [Fri, 28 Mar 2014 15:04:47 +0000 (16:04 +0100)]
Change-Id: I86fd805367e8ad1a4e9832c386caf28229e0dcdb

scilab/modules/graphics/demos/basic_functions/basic_functions_9.dem.sce

index 85dd254..97b4e93 100644 (file)
@@ -4,7 +4,10 @@
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
 function demo_basic_functions9()
-
+    function [z]=__milk_drop(x,y)
+        sq=x.^2+y.^2;
+        z= exp( exp(-sq).*(exp(cos(sq).^20)+8*sin(sq).^20+2*sin(2*(sq)).^8) );
+    endfunction
     mode(-1);
 
     my_handle             = scf(100001);
@@ -12,13 +15,16 @@ function demo_basic_functions9()
     demo_viewCode("basic_functions_9.dem.sce");
     my_plot_desc          = "milk drop";
     my_handle.figure_name = my_plot_desc;
+    my_handle.color_map = jetcolormap(256);
 
-    expr=[
-    "x = -2:0.1:2;"
-    "y = x;"
-    "z = eval3d(milk_drop, x, y);"
-    "plot3d(x, y, z)"];
-    execstr(expr);
+    x = -2:0.1:2;
+    y = x;
+    z = eval3d(__milk_drop, x, y);
+    plot3d(x, y, z);
+    e = gce();
+    e.color_flag = 1;
+    a = gca();
+    a.rotation_angles = [25, 30];
     // DEMO END
 
 endfunction