Demo mode : remove console prints
Pierre Marechal [Mon, 16 Jun 2008 16:00:37 +0000 (16:00 +0000)]
19 files changed:
scilab/modules/graphics/macros/Sfgrayplot.sci
scilab/modules/graphics/macros/Sgrayplot.sci
scilab/modules/graphics/macros/contour.sci
scilab/modules/graphics/macros/contourf.sci
scilab/modules/graphics/macros/errbar.sci
scilab/modules/graphics/macros/evans.sci
scilab/modules/graphics/macros/fac3d.sci
scilab/modules/graphics/macros/fac3d1.sci
scilab/modules/graphics/macros/fchamp.sci
scilab/modules/graphics/macros/fcontour.sci
scilab/modules/graphics/macros/fcontour2d.sci
scilab/modules/graphics/macros/fgrayplot.sci
scilab/modules/graphics/macros/fplot2d.sci
scilab/modules/graphics/macros/fplot3d.sci
scilab/modules/graphics/macros/fplot3d1.sci
scilab/modules/graphics/macros/genfac3d.sci
scilab/modules/graphics/macros/histplot.sci
scilab/modules/graphics/macros/plot.sci
scilab/modules/graphics/macros/surf.sci

index efcf772..14790e9 100644 (file)
@@ -15,25 +15,14 @@ function []=Sfgrayplot(x, y, f, strf, rect, nax, zminmax, colminmax, mesh, colou
 
        [lhs,rhs]=argn()
        if rhs == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of Sfgrayplot()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=x.^3+y'');';
-                       'xbasc()';
-                       'xset(""colormap"",jetcolormap(64))';
-                       'colorbar(-2,2)';
-                       'Sfgrayplot(-1:0.1:1,-1:0.1:1,Surf,strf=""031"",rect=[-1,-1,1,1]);';
-                       'xtitle(''Sfgrayplot demo: f(x,y)=x^3+y'')'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=x.^3+y");
+               f=gcf();
+               f.color_map = jetcolormap(64);
+               f.immediate_drawing = "off";
+               colorbar(-2,2);
+               Sfgrayplot(-1:0.1:1,-1:0.1:1,Surf,strf="031",rect=[-1,-1,1,1]);
+               xtitle("Sfgrayplot demo: f(x,y)=x^3+y");
+               f.immediate_drawing = "on";
                return
        elseif rhs < 3 then
                error("bad number of input arguments");
index 7dc453f..ef18122 100644 (file)
@@ -6,8 +6,8 @@ function []=Sgrayplot(x,y,z, strf, rect, nax, zminmax, colminmax, mesh, colout)
 //    a set of triangles built from the grid (here with n1=5, n2=3):
 //             _____________
 //             | /| /| /| /|
-//             |/_|/_|/_|/_| 
-//             | /| /| /| /| 
+//             |/_|/_|/_|/_|
+//             | /| /| /| /|
 //             |/_|/_|/_|/_|
 //
 // Copyright INRIA
@@ -18,25 +18,18 @@ function []=Sgrayplot(x,y,z, strf, rect, nax, zminmax, colminmax, mesh, colout)
        [lhs,rhs] = argn();
         
        if rhs == 0 then   // demo
-               title_demo = [
-                       '';
-                       'Demo of Sgrayplot()';
-                       '========================================';
-                       ''];
                
-               s_mat = ["t=-%pi:0.1:%pi";
-                       "m=sin(t)''*cos(t)";
-                       "xbasc()";
-                       "xset(''colormap'',jetcolormap(64))";
-                       "colorbar(-1,1)"
-                       "Sgrayplot(t,t,m,strf=''041'',zminmax=[-1,1])";
-                       "xtitle(''Sgrayplot demo f(x,y)=sin(x)*cos(y) on [-pi,pi]x[-pi,pi]'')"]
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               t=-%pi:0.1:%pi;
+               m=sin(t)'*cos(t)
+               f=gcf();
+               f.color_map = jetcolormap(64);
+               f.immediate_drawing = "off";
+               colorbar(-1,1);
+               Sgrayplot(t,t,m,strf="041",zminmax=[-1,1]);
+               xtitle("Sgrayplot demo f(x,y)=sin(x)*cos(y) on [-pi,pi]x[-pi,pi]");
+               f.immediate_drawing = "on";
                return
+               
        elseif rhs < 3 then
                error("bad number of input arguments")
        end
index feeb855..cbc94ad 100644 (file)
@@ -7,32 +7,22 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function contour(x,y,z,nz,theta,alpha,leg,flag,ebox,zlev)
-  
+       
        rhs=argn(2);
-       if rhs == 0 then   // demo
        
-               title_demo = [
-                       '';
-                       'Demo of contour()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf1(x,y)'',''z=x^2+y^3'');';
-                       'x=-1:0.1:1; y=x;'
-                       'subplot(211);contour(x,y,Surf1,10);'
-                       'deff(''[z]=Surf2(x,y)'',''z=x^2+y^2'');';
-                       'z=eval3d(Surf2,x,y)'
-                       'subplot(212);plot3d(x,y,z);contour(x,y,z+0.1,10,flag=[0 2 4]);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+       if rhs == 0 then   // demo
+               deff('[z]=Surf1(x,y)','z=x^2+y^3');
+               x=-1:0.1:1;
+               y=x;
+               subplot(211);
+               contour(x,y,Surf1,10);
+               z=eval3d(Surf2,x,y)
+               subplot(212);
+               plot3d(x,y,z);
+               contour(x,y,z+0.1,10,flag=[0 2 4]);
                return
        end
-
-  
+       
   if rhs<4, error('contour requires at least 4 arguments'),end;
   levels=[]
 
index 8d79471..9443d5c 100644 (file)
@@ -13,20 +13,10 @@ function contourf(x,y,z,nv,style,strf,leg,rect,nax)
        newstyle = get('figure_style')=='new'
        
        if nin == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of contourf()';
-                       '========================================';
-                       ''];
-               
-               s_mat=['t=-%pi:0.1:%pi;m=sin(t)''*cos(t);contourf(t,t,m);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
-               return
+               t = -%pi:0.1:%pi;
+               m = sin(t)'*cos(t);
+               contourf(t,t,m);
+               return;
        end
 
 if nin <= 8 then nax=[1,10,1,10];end 
index 2b691a4..87ad871 100644 (file)
@@ -23,26 +23,14 @@ function []=errbar(x,y,em,ep)
        [lhs,rhs]=argn(0)
        
        if rhs == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of errbar()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'x=0:0.1:2*%pi;';
-                       'y=[sin(x);cos(x)]'';x=[x;x]''';
-                       'plot2d(x,y);';
-                       'errbar(x,y,0.05*ones(x),0.03*ones(x));'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
-               return
+               x=0:0.1:2*%pi;;
+               y=[sin(x);cos(x)]';
+               x=[x;x]';
+               plot2d(x,y);
+               errbar(x,y,0.05*ones(x),0.03*ones(x));
+               return;
        end
-   
 xselect();
 [n1,n2]=size(x);
 y1=matrix(y-em,1,n1*n2);
index da7f641..4338172 100644 (file)
@@ -19,23 +19,9 @@ function []=evans(n,d,kmax)
        [lhs,rhs]=argn(0)
        
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of evans()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'xbasc();';
-                       'n=real(poly([0.1-%i 0.1+%i,-10],''s''));';
-                       'd=real(poly([-1 -2 -%i %i],''s''));';
-                       'evans(n,d,80);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               n=real(poly([0.1-%i 0.1+%i,-10],'s'));
+               d=real(poly([-1 -2 -%i %i],'s'));
+               evans(n,d,80);
                return
        end
 
index 6baa995..edf621b 100644 (file)
@@ -9,35 +9,23 @@
 function fac3d(x,y,z,T,A,leg,flags,ebox)
 
        // Copyright INRIA
-        
+       
        [lhs,rhs]=argn(0)
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fac3d()';
-                       '========================================';
-                       '';
-                       'WARNING : fac3d is obsolete see plot3d plot3d1 instead';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[x,y,z]=sph(alp,tet)'',[''x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)'';';
-                       '''y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)'';';
-                       '''z=r*sin(alp)+orig(3)*ones(tet)'']);';
-                       'r=1;orig=[0 0 0];';
-                       '[x1,y1,z1]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));';
-                       '[n1,m1]=size(x1);';
-                       'r=1/2;orig=[-1 0 0];';
-                       '[x2,y2,z2]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));';
-                       '[n2,m2]=size(x2);';
-                       'x=[x1 x2];y=[y1 y2];z=[z1 z2];';
-                       'plot3d(x,y,z);';];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[x,y,z]=sph(alp,tet)",["x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)"; ..
+                       "y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)"; ..
+                       "z=r*sin(alp)+orig(3)*ones(tet)"]);
+               r=1;
+               orig=[0 0 0];
+               [x1,y1,z1]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));
+               [n1,m1]=size(x1);
+               r=1/2;orig=[-1 0 0];
+               [x2,y2,z2]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));
+               [n2,m2]=size(x2);
+               x=[x1 x2];
+               y=[y1 y2];
+               z=[z1 z2];
+               plot3d(x,y,z);
                return
        end
        
index 333df51..342158a 100644 (file)
@@ -9,41 +9,31 @@
 function fac3d1(x,y,z,T,A,leg,flags,ebox)
        
        // Copyright INRIA
-        
-       [lhs,rhs]=argn(0)
+       
+       [lhs,rhs]=argn(0);
+       
+       write(%io(2),'WARNING : fac3d1 is obsolete see plot3d plot3d1 instead');
+       
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fac3d1()';
-                       '========================================';
-                       '';
-                       'WARNING : fac3d1 is obsolete see plot3d plot3d1 instead';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[x,y,z]=sph(alp,tet)'',[''x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)'';';
-                       '''y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)'';';
-                       '''z=r*sin(alp)+orig(3)*ones(tet)'']);';
-                       'r=1;orig=[0 0 0];';
-                       '[x1,y1,z1]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));';
-                       '[n1,m1]=size(x1);';
-                       'r=1/2;orig=[-1 0 0];';
-                       '[x2,y2,z2]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));';
-                       '[n2,m2]=size(x2);';
-                       'x=[x1 x2];y=[y1 y2];z=[z1 z2];';
-                       'plot3d1(x,y,z);';];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[x,y,z]=sph(alp,tet)",["x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)"; ..
+                       "y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)"; ..
+                       "z=r*sin(alp)+orig(3)*ones(tet)"]);
+               r=1;
+               orig=[0 0 0];
+               [x1,y1,z1]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));
+               [n1,m1]=size(x1);
+               r=1/2;
+               orig=[-1 0 0];
+               [x2,y2,z2]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20));
+               [n2,m2]=size(x2);
+               x=[x1 x2];
+               y=[y1 y2];
+               z=[z1 z2];
+               plot3d1(x,y,z);
                return
        end
        
-       write(%io(2),'WARNING : fac3d1 is obsolete see plot3d plot3d1 instead');
-       
-       select rhs 
+       select rhs
                case 3 then plot3d1(x,y,z) 
                case 4 then plot3d1(x,y,z,T) 
                case 5 then plot3d1(x,y,z,T,A) 
@@ -51,4 +41,5 @@ function fac3d1(x,y,z,T,A,leg,flags,ebox)
                case 7 then plot3d1(x,y,z,T,A,leg,flags) 
                case 8 then plot3d1(x,y,z,T,A,leg,flags,ebox) 
        end
+       
 endfunction
index 9ad4266..94d2f6f 100644 (file)
@@ -23,26 +23,13 @@ function []=fchamp(macr_f,fch_t,fch_xr,fch_yr,arfact,rect,strf)
        
        [lhs,rhs]=argn(0)
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fchamp()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[xdot] = derpol(t,x)'',[''xd1 = x(2)'';';
-                       '''xd2 = -x(1) + (1 - x(1)**2)*x(2)'';';
-                       '''xdot = [ xd1 ; xd2 ]'']);';
-                       'fchamp(derpol,0,-1:0.1:1,-1:0.1:1,1);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[xdot] = derpol(t,x)",["xd1 = x(2)"; ..
+                       "xd2 = -x(1) + (1 - x(1)**2)*x(2)"; ..
+                       "xdot = [ xd1 ; xd2 ]"]);
+               fchamp(derpol,0,-1:0.1:1,-1:0.1:1,1);
                return
        end
-  
   if rhs <= 2,fch_xr=-1:0.1:1;end
   if rhs <= 3,fch_yr=-1:0.1:1;end
 
index fd3fae0..4f0bb9b 100644 (file)
@@ -38,22 +38,10 @@ function fcontour(xr,yr,f,nz,teta,alpha,leg,flag,ebox,zlev)
 //!
 
        [lhs,rhs]=argn(0)
+       
        if rhs == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fcontour()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=x**2+y**2'');';
-                       'fcontour(-1:0.1:1,-1:0.1:1,Surf,10);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=x**2+y**2");
+               fcontour(-1:0.1:1,-1:0.1:1,Surf,10);
                return
        end
 
index b5c331b..cd8888c 100644 (file)
@@ -15,21 +15,8 @@ function fcontour2d(xr,yr,f,nz,style,strf,leg,rect,nax,void)
        [lhs,rhs]=argn(0);
        
        if rhs == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fcontour2d()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=x**3+y'');';
-                       'fcontour2d(-1:0.1:1,-1:0.1:1,Surf,10,style=1:10,rect=[-1,-1,1,1]*1.5,strf='"011"');'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=x**3+y");
+               fcontour2d(-1:0.1:1,-1:0.1:1,Surf,10,style=1:10,rect=[-1,-1,1,1]*1.5,strf="011");
                return
        end
 
index 9293eda..26f4760 100644 (file)
@@ -23,21 +23,8 @@ function []=fgrayplot(x,y,f,strf,rect,nax,void)
        [lhs,rhs]=argn(0);
        
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fgrayplot()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=x**2+y**2'');';
-                       'fgrayplot(-1:0.1:1,-1:0.1:1,Surf);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=x**2+y**2");
+               fgrayplot(-1:0.1:1,-1:0.1:1,Surf);
                return
        end
 
index 01aa5cf..7c3cd15 100644 (file)
@@ -16,21 +16,8 @@ function []=fplot2d(xr,f,style,strf,leg,rect,nax,void)
        
        [lhs,rhs]=argn(0)
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fplot2d()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[y]=f(x)'',''y=sin(x)+cos(x)'');';
-                       'fplot2d(0:0.1:%pi,f);'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[y]=f(x)","y=sin(x)+cos(x)");
+               fplot2d(0:0.1:%pi,f);
                return
        end
        
index f87166e..5f27daa 100644 (file)
@@ -20,22 +20,9 @@ function fplot3d(xr,yr,f,theta,alpha,leg,flag,ebox)
        
        [lhs,rhs]=argn(0)
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fplot3d()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=sin(x)*cos(y)'');';
-                       't=-%pi:0.3:%pi;';
-                       'fplot3d(t,t,Surf,35,45,'"X@Y@Z'");'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=sin(x)*cos(y)");
+               t=-%pi:0.3:%pi;
+               fplot3d(t,t,Surf,35,45,"X@Y@Z");
                return
        end
 
index eee9ca4..79119bf 100644 (file)
@@ -22,22 +22,9 @@ function []=fplot3d1(xr,yr,f,theta,alpha,leg,flag,ebox)
        
        [lhs,rhs]=argn(0)
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of fplot3d1()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'deff(''[z]=Surf(x,y)'',''z=sin(x)*cos(y)'');';
-                       't=-%pi:0.3:%pi;';
-                       'fplot3d1(t,t,Surf,35,45,'"X@Y@Z'");'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               deff("[z]=Surf(x,y)","z=sin(x)*cos(y)");
+               t=-%pi:0.3:%pi;
+               fplot3d1(t,t,Surf,35,45,"X@Y@Z");
                return
        end
 
index 3f44681..969551d 100644 (file)
@@ -26,23 +26,10 @@ function [xx,yy,zz]=genfac3d(x,y,zmat,mask)
        [lhs,rhs]=argn(0)
        
        if rhs <= 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of genfac3d()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       't=(0:10)''*%pi/5;';
-                       'zmat=sin(t)*cos(t'');';
-                       '[xx,yy,zz]=genfac3d(t,t,zmat,zmat>=0);';
-                       'plot3d(xx,yy,zz)'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               t=(0:10)'*%pi/5;
+               zmat=sin(t)*cos(t');
+               [xx,yy,zz]=genfac3d(t,t,zmat,zmat>=0);
+               plot3d(xx,yy,zz);
                return
        end
 
index a6915a0..6a87ec5 100644 (file)
@@ -32,26 +32,16 @@ function histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,axesflag,norm
 //    - add some checking on n|x and data
 //
        [lhs,rhs]=argn()
+       
        if rhs == 0 then   // demo
-               
-               title_demo = [
-                       '';
-                       'Demo of histplot()';
-                       '========================================';
-                       ''];
-               
-               s_mat=[
-                       'histplot([-4.5:0.25:4.5],rand(1,20000,''n''),style=2);';
-                       'deff(''[y]=f(x)'',''y=exp(-x.*x/2)/sqrt(2*%pi);'');';
-                       'x=-4.5:0.125:4.5;x=x'';plot2d(x,f(x),26,'"000'");';
-                       'titre= ''macro histplot : (normalized) histogram plot'';';
-                       'xtitle(titre,''C (Classes)'',''N(C)/(Nmax length(C))'');';
-                       'legends([''gaussian random sample histogram'' ''exact gaussian density''],[2 26],1)'];
-               
-               write(%io(2),title_demo);
-               write(%io(2),s_mat);
-               write(%io(2),' ');
-               execstr(s_mat);
+               histplot([-4.5:0.25:4.5],rand(1,20000,'n'),style=2);
+               deff("[y]=f(x)","y=exp(-x.*x/2)/sqrt(2*%pi);");
+               x=-4.5:0.125:4.5;
+               x=x';
+               plot2d(x,f(x),26,"000");
+               titre= "macro histplot : (normalized) histogram plot";
+               xtitle(titre,"C (Classes)","N(C)/(Nmax length(C))");
+               legends(["gaussian random sample histogram" "exact gaussian density"],[2 26],1);
                return
        end
    
index 3e17fe4..727ef20 100644 (file)
@@ -16,22 +16,11 @@ function plot(varargin)
 
 if ~rhs
        //LineSpec and PropertySpec examples:
-       title_demo = [
-               '';
-               'Demo of plot()';
-               '========================================';
-               ''];
-       
-       s_mat=["t=0:%pi/20:2*%pi;";
-       "subplot(211)";
-       "plot(t,sin(t),''ro-.'',t,cos(t),''cya+'',t,abs(sin(t)),''--mo'')";
-       "subplot(212)";
-       "plot([t ;t],[sin(t) ;cos(t)],''xdat'',[1:2])"];
-       
-       write(%io(2),title_demo);
-       write(%io(2),s_mat);
-       write(%io(2),' ');
-       execstr(s_mat);
+       t = 0:%pi/20:2*%pi;
+       subplot(211);
+       plot(t,sin(t),'ro-.',t,cos(t),'cya+',t,abs(sin(t)),'--mo');
+       subplot(212);
+       plot([t ;t],[sin(t) ;cos(t)],'xdat',[1:2]);
        return;
 end
 
index 4d331a9..529b720 100644 (file)
@@ -12,25 +12,21 @@ function surf(varargin)
 [lhs,rhs]=argn(0);
 
 if ~rhs
-  s_mat = [ "Z= [   0.0001    0.0013    0.0053   -0.0299   -0.1809   -0.2465   -0.1100   -0.0168   -0.0008   -0.0000;";
-         "0.0005    0.0089    0.0259   -0.3673   -1.8670   -2.4736   -1.0866   -0.1602   -0.0067    0.0000;";
-         "0.0004    0.0214    0.1739   -0.3147   -4.0919   -6.4101   -2.7589   -0.2779    0.0131    0.0020;";
-         "-0.0088   -0.0871    0.0364    1.8559    1.4995   -2.2171   -0.2729    0.8368    0.2016    0.0130;";
-         "-0.0308   -0.4313   -1.7334   -0.1148    3.0731    0.4444    2.6145    2.4410    0.4877    0.0301;";
-         "-0.0336   -0.4990   -2.3552   -2.1722    0.8856   -0.0531    2.6416    2.4064    0.4771    0.0294;";
-         "-0.0137   -0.1967   -0.8083    0.2289    3.3983    3.1955    2.4338    1.2129    0.2108    0.0125;";
-         "-0.0014   -0.0017    0.3189    2.7414    7.1622    7.1361    3.1242    0.6633    0.0674    0.0030;";
-         "0.0002    0.0104    0.1733    1.0852    2.6741    2.6725    1.1119    0.1973    0.0152    0.0005;";
-         "0.0000    0.0012    0.0183    0.1099    0.2684    0.2683    0.1107    0.0190    0.0014    0.0000];";
-      "lines(0);";
-      "f=gcf();";
-      "f.color_map = jetcolormap(64);";
-      "surf(Z,''edgeco'',''b'',''marker'',''d'',''markersiz'',9,''markeredg'',''red'',''markerfac'',''k'')"];
-  
-  write(%io(2),"Demo of surf");
-  write(%io(2),s_mat);
-  execstr(s_mat);
-  return;
+       Z= [  0.0001    0.0013    0.0053   -0.0299   -0.1809   -0.2465   -0.1100   -0.0168   -0.0008   -0.0000; ..
+          0.0005    0.0089    0.0259   -0.3673   -1.8670   -2.4736   -1.0866   -0.1602   -0.0067    0.0000; ..
+          0.0004    0.0214    0.1739   -0.3147   -4.0919   -6.4101   -2.7589   -0.2779    0.0131    0.0020; ..
+         -0.0088   -0.0871    0.0364    1.8559    1.4995   -2.2171   -0.2729    0.8368    0.2016    0.0130; ..
+         -0.0308   -0.4313   -1.7334   -0.1148    3.0731    0.4444    2.6145    2.4410    0.4877    0.0301; ..
+         -0.0336   -0.4990   -2.3552   -2.1722    0.8856   -0.0531    2.6416    2.4064    0.4771    0.0294; ..
+         -0.0137   -0.1967   -0.8083    0.2289    3.3983    3.1955    2.4338    1.2129    0.2108    0.0125; ..
+         -0.0014   -0.0017    0.3189    2.7414    7.1622    7.1361    3.1242    0.6633    0.0674    0.0030; ..
+          0.0002    0.0104    0.1733    1.0852    2.6741    2.6725    1.1119    0.1973    0.0152    0.0005; ..
+          0.0000    0.0012    0.0183    0.1099    0.2684    0.2683    0.1107    0.0190    0.0014    0.0000];
+       lines(0);
+       f=gcf();
+       f.color_map = jetcolormap(64);
+       surf(Z,"edgeco","b","marker","d","markersiz",9,"markeredg","red","markerfac","k");
+       return;
 end
 
 X=[];