Graphics macros & demos: replace gcf with scf 38/14238/2
Paul Bignier [Mon, 31 Mar 2014 07:58:20 +0000 (09:58 +0200)]
Complementary commit to https://codereview.scilab.org/#/c/14174/

Change-Id: Iedf7628034210da20b8a10e615c4ca56244274ec

scilab/modules/cacsd/macros/zgrid.sci
scilab/modules/graphics/demos/2d_3d_plots/fgrayplot.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/zgrid.dem.sce
scilab/modules/graphics/macros/Sgrayplot.sci
scilab/modules/graphics/macros/fgrayplot.sci
scilab/modules/graphics/macros/polarplot.sci

index 62ce32c..ddce5f1 100644 (file)
@@ -43,6 +43,10 @@ function []=zgrid(varargin)
         wn=defaultwn
         zeta = defaultzeta
         colors = defaultcolors
+        fig = scf();
+        my_plot_desc    = "zgrid";
+        fig.figure_name = my_plot_desc;
+        xtitle(my_plot_desc," "," "," ");
     case 1 then
         zeta =  varargin(1)
         if type(zeta)<>1|~isreal(zeta) then
index 488e122..5d3fd78 100644 (file)
@@ -6,19 +6,12 @@
 
 function demo_fgrayplot()
 
-    my_handle             = scf(100001);
-    clf(my_handle,"reset");
     demo_viewCode("fgrayplot.dem.sce");
 
     // DEMO START
-
-    my_plot_desc          = "fgrayplot";
-    my_handle.figure_name = my_plot_desc;
-
     fgrayplot();
-    xtitle(my_plot_desc," "," "," ");
-
     // DEMO END
+
 endfunction
 
 demo_fgrayplot();
index 34ad0a8..07b5754 100644 (file)
@@ -5,22 +5,16 @@
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
 
-function demo_zgrig()
+function demo_zgrid()
 
-    my_handle             = scf(100001);
-    clf(my_handle,"reset");
     demo_viewCode("zgrid.dem.sce");
 
     // DEMO START
-
-    my_plot_desc          = "zgrid";
-    my_handle.figure_name = my_plot_desc;
-
     zgrid();
-    xtitle(my_plot_desc," "," "," ");
+    // DEMO END
 
 endfunction
 
 
-demo_zgrig();
-clear demo_zgrig;
\ No newline at end of file
+demo_zgrid();
+clear demo_zgrid;
index 792f9fe..5e0e125 100644 (file)
@@ -31,7 +31,7 @@ function []=Sgrayplot(x,y,z, strf, rect, nax, zminmax, colminmax, mesh, colout)
 
         t=-%pi:0.1:%pi;
         m=sin(t)'*cos(t)
-        f=gcf();
+        f=scf();
         f.color_map = jetcolormap(64);
         f.immediate_drawing = "off";
         colorbar(-1,1);
index f53bf50..6f02353 100644 (file)
@@ -23,7 +23,10 @@ function []=fgrayplot(x,y,f,strf,rect,nax,void)
     [lhs,rhs]=argn(0);
 
     if rhs <= 0 then   // demo
-        f = gcf();
+        f = scf(100001);
+        my_plot_desc  = "fgrayplot";
+        f.figure_name = my_plot_desc;
+        xtitle(my_plot_desc," "," "," ");
         f.color_map = coolcolormap(100);
         deff("[z]=Surf(x,y)","z=cos(x).^2+sin(y).^2");
         fgrayplot(-%pi:0.1:%pi,-%pi:0.1:%pi, Surf);
index 74330c1..5886bb6 100644 (file)
@@ -12,7 +12,7 @@ function polarplot(theta,rho,style,strf,leg,rect)
     if rhs<=0 then
         theta=0:.01:2*%pi;
         rho=sin(2*theta).*cos(2*theta)
-        clf();
+        scf();
         polarplot(theta,rho)
         return
     end