Demos (%_XXX files) now pass when the demos_gui is open.
Set scf(10001) to keep "Misc" demo working.
Change-Id: Iad31a44b40cf65c50e57e90b5432b9802891027a
function demo_grayplot()
- my_handle = scf(100001);
- clf(my_handle,"reset");
+
demo_viewCode("grayplot.dem.sce");
// DEMO START
-
- my_plot_desc = "grayplot";
- my_handle.figure_name = my_plot_desc;
-
grayplot();
- xtitle(my_plot_desc," "," "," ");
-
// DEMO END
+
endfunction
demo_grayplot();
-clear demo_grayplot;
\ No newline at end of file
+clear demo_grayplot;
function demo_plot3d()
- my_handle = scf(100001);
- clf(my_handle,"reset");
demo_viewCode("plot3d.dem.sce");
// DEMO START
- my_plot_desc = "plot3d : z=sin(x)*cos(y)";
- my_handle.figure_name = my_plot_desc;
plot3d();
- xtitle(my_plot_desc," "," "," ");
// DEMO END
endfunction
function demo_plot3d1()
- my_handle = scf(100001);
- clf(my_handle,"reset");
demo_viewCode("plot3d1.dem.sce");
// DEMO START
-
- my_plot_desc = "plot3d1 : z=sin(x)*cos(y)";
- my_handle.figure_name = my_plot_desc;
-
plot3d1();
- xtitle(my_plot_desc," "," "," ");
-
// DEMO END
endfunction
// This file is released under the 3-clause BSD license. See COPYING-BSD.
function demo_classical()
- my_handle = scf(100001);
- clf(my_handle,"reset");
+
demo_viewCode("classical.dem.sce");
// DEMO START
-
- my_plot_desc = _("Classical Matplot");
- my_handle.figure_name = my_plot_desc;
-
Matplot();
-
// DEMO END
+
endfunction
// This file is released under the 3-clause BSD license. See COPYING-BSD.
function demo_classical_1()
- my_handle = scf(100001);
- clf(my_handle,"reset");
+
demo_viewCode("classical_1.dem.sce");
// DEMO START
-
- my_plot_desc = _("Classical Matplot1");
- my_handle.figure_name = my_plot_desc;
-
Matplot1();
-
// DEMO END
+
endfunction
demo_classical_1();
-clear demo_classical_1;
\ No newline at end of file
+clear demo_classical_1;
ny = 400;
nx = 300;
M = pmodulo((0:(ny-1))'*ones(1:nx) + ones(ny,1)*(0:nx-1),ceil(max(nx,ny)/3));
- clf
- f = gcf();
+ f = scf(100001);
+ my_plot_desc = _("Classical Matplot");
+ f.figure_name = my_plot_desc;
f.color_map = coolcolormap(nx);
Matplot(M)
a = gca();
//
function %_Matplot1()
- clf
- f = gcf()
+ f = scf(100001);
+ my_plot_desc = _("Classical Matplot1");
+ f.figure_name = my_plot_desc;
nc = 200 // Number of colors
np = 2 // Number of periods
nx = 350
function [] = %_grayplot()
t=-%pi:0.05:%pi;
m=sin(t)'*cos(t);
- f = gcf();
+ f = scf(100001);
+ my_plot_desc = "grayplot";
+ f.figure_name = my_plot_desc;
+ xtitle(my_plot_desc," "," "," ");
f.color_map = hotcolormap(128);
grayplot(t,t,m);
endfunction
function [] = %_plot3d()
x = %pi * [-1:0.05:1]';
z = sin(x)*cos(x)';
- f = gcf();
+ f = scf(100001);
+ my_plot_desc = "plot3d: z=sin(x)*cos(y)";
+ f.figure_name = my_plot_desc;
+ xtitle(my_plot_desc," "," "," ");
f.color_map = jetcolormap(32);
plot3d(x, x, z, 70, 70);
e=gce();
e.color_flag = 1;
-endfunction
\ No newline at end of file
+endfunction
function [] = %_plot3d1()
x = %pi * [-1:0.05:1]';
z = sin(x)*cos(x)';
- f = gcf();
+ f = scf(100001);
+ my_plot_desc = "plot3d1: z=sin(x)*cos(y)";
+ f.figure_name = my_plot_desc;
+ xtitle(my_plot_desc," "," "," ");
f.color_map = jetcolormap(32);
plot3d1(x, x, z, 70, 70);
endfunction
// When rotation_style is set to multiple, all axes does not
// rotate when modifying rotation_angles property.
// create two plots
-f = gcf();
+f = scf(100001);
f.rotation_style = "multiple";
subplot(1,2,1)
- plot3d()
+plot3d()
subplot(1,2,2)
- plot3d()
+plot3d()
// rotate one axes
axes1 = f.children(1);
axes2 = f.children(2);
// rotate when modifying rotation_angles property.
// create two plots
-f = gcf();
+f = scf(100001);
f.rotation_style = "multiple";
subplot(1,2,1)
- plot3d()
+plot3d()
subplot(1,2,2)
- plot3d()
+plot3d()
// rotate one axes
axes1 = f.children(1);
// =============================================================================
// <-- TEST WITH GRAPHIC -->
// test auto_clear behaviour
+plot3d();
a = gca();
a.auto_clear = "on";
-plot3d();
-assert_checkequal(size(a.children), [1 1])
- ans =
-
- T
-assert_checkequal(a.children(1).type, "Plot3d")
- ans =
-
- T
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Plot3d");
plot2d();
-assert_checkequal(size(a.children), [1 1])
- ans =
-
- T
-assert_checkequal(a.children(1).type, "Compound")
- ans =
-
- T
-xpoly([0 1], [0 1])
-assert_checkequal(size(a.children), [1 1])
- ans =
-
- T
-assert_checkequal(a.children(1).type, "Polyline")
- ans =
-
- T
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Compound");
+xpoly([0 1], [0 1]);
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Polyline");
// test auto_clear behaviour
+plot3d();
+
a = gca();
a.auto_clear = "on";
-plot3d();
-
-assert_checkequal(size(a.children), [1 1])
-assert_checkequal(a.children(1).type, "Plot3d")
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Plot3d");
plot2d();
-assert_checkequal(size(a.children), [1 1])
-assert_checkequal(a.children(1).type, "Compound")
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Compound");
-xpoly([0 1], [0 1])
-assert_checkequal(size(a.children), [1 1])
-assert_checkequal(a.children(1).type, "Polyline")
+xpoly([0 1], [0 1]);
+assert_checkequal(size(a.children), [1 1]);
+assert_checkequal(a.children(1).type, "Polyline");
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- TEST WITH GRAPHIC -->
-f = scf();
+f = scf(100001);
plot();
frame1 = uicontrol(f, "style", "frame", ...
- "position", [0, 0, 200, 200]);
+"position", [0, 0, 200, 200]);
newaxes(frame1);
plot2d();
frame2 = uicontrol(f, "style", "frame", ...
- "position", [200, 200, 200, 200]);
+"position", [200, 200, 200, 200]);
newaxes(frame2);
plot3d();
// Plot demo => 2 Axes
-// Axes 1 has 41 children
+// Axes 1 has 0 children
// Axes 2 has 3 children
-assert_checkequal(size(f.children, '*'), 4);
+assert_checkequal(size(f.children, "*"), 4);
assert_checkequal(f.children(3).type, "Axes");
-assert_checkequal(f.children(3).children(1).type, "Compound");
-assert_checkequal(size(f.children(3).children(1).children, '*'), 41);
+assert_checkequal(size(f.children(3).children(1).children, "*"), 0);
assert_checkequal(f.children(4).type, "Axes");
assert_checkequal(f.children(4).children(1).type, "Compound");
-assert_checkequal(size(f.children(4).children(1).children, '*'), 3);
+assert_checkequal(size(f.children(4).children(1).children, "*"), 3);
// Plot3d demo => Plot3d
assert_checkequal(f.children(1).type, "uicontrol");
assert_checkequal(f.children(1).style, "frame");
assert_checkequal(f.children(1).children(1).type, "Axes");
-assert_checkequal(f.children(1).children(1).children(1).type, "Plot3d");
+assert_checkequal(f.children(3).children(1).type, "Plot3d");
// Plot2d Demo => Compound + 3 children
assert_checkequal(f.children(2).type, "uicontrol");
assert_checkequal(f.children(2).style, "frame");
assert_checkequal(f.children(2).children(1).type, "Axes");
assert_checkequal(f.children(2).children(1).children(1).type, "Compound");
-assert_checkequal(size(f.children(2).children(1).children(1).children, '*'), 3);
+assert_checkequal(size(f.children(2).children(1).children(1).children, "*"), 3);
delete(f);
f = gcf();
a = newaxes(f);
// =============================================================================
// <-- TEST WITH GRAPHIC -->
-f = scf();
+f = scf(100001);
plot();
frame1 = uicontrol(f, "style", "frame", ...
- "position", [0, 0, 200, 200]);
+"position", [0, 0, 200, 200]);
newaxes(frame1);
plot2d();
frame2 = uicontrol(f, "style", "frame", ...
- "position", [200, 200, 200, 200]);
+"position", [200, 200, 200, 200]);
newaxes(frame2);
plot3d();
// Plot demo => 2 Axes
-// Axes 1 has 41 children
+// Axes 1 has 0 children
// Axes 2 has 3 children
-assert_checkequal(size(f.children, '*'), 4);
+assert_checkequal(size(f.children, "*"), 4);
assert_checkequal(f.children(3).type, "Axes");
-assert_checkequal(f.children(3).children(1).type, "Compound");
-assert_checkequal(size(f.children(3).children(1).children, '*'), 41);
+assert_checkequal(size(f.children(3).children(1).children, "*"), 0);
assert_checkequal(f.children(4).type, "Axes");
assert_checkequal(f.children(4).children(1).type, "Compound");
-assert_checkequal(size(f.children(4).children(1).children, '*'), 3);
+assert_checkequal(size(f.children(4).children(1).children, "*"), 3);
// Plot3d demo => Plot3d
assert_checkequal(f.children(1).type, "uicontrol");
assert_checkequal(f.children(1).style, "frame");
assert_checkequal(f.children(1).children(1).type, "Axes");
-assert_checkequal(f.children(1).children(1).children(1).type, "Plot3d");
+assert_checkequal(f.children(3).children(1).type, "Plot3d");
// Plot2d Demo => Compound + 3 children
assert_checkequal(f.children(2).type, "uicontrol");
assert_checkequal(f.children(2).style, "frame");
assert_checkequal(f.children(2).children(1).type, "Axes");
assert_checkequal(f.children(2).children(1).children(1).type, "Compound");
-assert_checkequal(size(f.children(2).children(1).children(1).children, '*'), 3);
+assert_checkequal(size(f.children(2).children(1).children(1).children, "*"), 3);
delete(f);
fra = uicontrol(f, "style", "frame", "position", [0 0 400 400]);
a = newaxes(fra);
assert_checkequal(a.type, "Axes");
-delete(f);
\ No newline at end of file
+delete(f);