* Bug 15881 fixed: Demos stems bars histograms gathered 24/20624/4
Samuel GOUGEON [Mon, 19 Nov 2018 05:26:25 +0000 (06:26 +0100)]
  http://bugzilla.scilab.org/15881

Change-Id: Ib2399037d5387d4662d98be985fae2c0524cbed3

scilab/CHANGES.md
scilab/modules/graphics/demos/2d_3d_plots/2d_3d_plots.dem.gateway.sce
scilab/modules/graphics/demos/graphics.dem.gateway.sce
scilab/modules/graphics/demos/hist_bar_stem/bar.dem.sce [moved from scilab/modules/graphics/demos/bar/bar.dem.sce with 92% similarity]
scilab/modules/graphics/demos/hist_bar_stem/bars_custom.dem.sce [moved from scilab/modules/graphics/demos/basic_functions/basic_functions_7.dem.sce with 75% similarity]
scilab/modules/graphics/demos/hist_bar_stem/hist3d.dem.sce [moved from scilab/modules/graphics/demos/2d_3d_plots/hist3d.dem.sce with 100% similarity]
scilab/modules/graphics/demos/hist_bar_stem/histBarStem.dem.gateway.sce [new file with mode: 0644]
scilab/modules/graphics/demos/hist_bar_stem/histplot.dem.sce [moved from scilab/modules/graphics/demos/2d_3d_plots/histplot.dem.sce with 100% similarity]
scilab/modules/graphics/demos/hist_bar_stem/plot2d3.dem.sce [moved from scilab/modules/graphics/demos/2d_3d_plots/plot2d3.dem.sce with 55% similarity]

index 102e680..af7060a 100644 (file)
@@ -686,6 +686,7 @@ Known issues
 * [#15867](http://bugzilla.scilab.org/show_bug.cgi?id=15867): For input encoded integers, `setdiff` returned selected elements in decreasing order.
 * [#15878](http://bugzilla.scilab.org/show_bug.cgi?id=15878): `sgrid` and `evans` were broken.
 * [#15880](http://bugzilla.scilab.org/show_bug.cgi?id=15880): `sgrid` needed some improvements: Labeling was sometimes ambiguous ; large circles were not labeled ; data_bounds did not always take the input wn into account ; named and #RRGGBB colors specifications could not be used. `evans` needed some improvements: the block of legends hid data ; asymptotes were too visible.
+* [#15881](http://bugzilla.scilab.org/show_bug.cgi?id=15881): Demos about stems, bars and histograms were spread in several subsections.
 * [#15886](http://bugzilla.scilab.org/show_bug.cgi?id=15886): Display of polynomials was broken.
 * [#15890](http://bugzilla.scilab.org/show_bug.cgi?id=15890): `evstr` sometimes yielded some `+[]` warnings.
 * [#15907](http://bugzilla.scilab.org/show_bug.cgi?id=15907): `filter` was corrupting its input state array
index 7edaed5..e09b558 100644 (file)
@@ -7,11 +7,8 @@ demopath = get_absolute_file_path("2d_3d_plots.dem.gateway.sce");
 
 subdemolist = [                                   ..
 "plot2d"         , "plot2d.dem.sce"          ; ..
-"plot2d3"        , "plot2d3.dem.sce"         ; ..
 "plotyy"         , "plotyy.dem.sce"          ; ..
 "plotyyy"        , "plotyyy.dem.sce"         ; ..
-"histplot"       , "histplot.dem.sce"        ; ..
-"hist3d"         , "hist3d.dem.sce"          ; ..
 "fplot2d"        , "fplot2d.dem.sce"         ; ..
 "param3d (1)"    , "param3d_1.dem.sce"       ; ..
 "param3d (2)"    , "param3d_2.dem.sce"       ; ..
index c7cbc9f..508eb74 100644 (file)
@@ -16,15 +16,15 @@ function subdemolist = demo_gateway()
     _("Basic functions")             ,"basic_functions/basic_functions.dem.gateway.sce"     ; ..
     _("Animation")                   ,"anim/anim.dem.gateway.sce"                           ; ..
     _("Finite Elements")             ,"fec/fec.dem.gateway.sce"                             ; ..
+    _("Stems bars histograms")        ,"hist_bar_stem/histBarStem.dem.gateway.sce"           ; ..
     _("Bezier curves and surfaces")  ,"bezier/bezier.dem.gateway.sce"                       ; ..
     _("More surfaces")               ,"surface/surfaces.dem.gateway.sce"                    ; ..
     _("Complex elementary functions"),"cmplxfunc/cmplxfunc.dem.gateway.sce"                 ; ..
-    _("bar histogram")               ,"bar/bar.dem.sce"; ..
     _("Datatips")                    ,"datatips/datatips.dem.gateway.sce"                   ; ..
     _("LaTeX/MathML")                ,"textrendering/textrendering.dem.gateway.sce"         ; ..
     _("Lighting")                    ,"lighting/lighting.dem.gateway.sce"                   ; ..
     _("Colormap")                    ,"colormap/colormaps.dem.sce"                           ; ..
-    _("Matplot")                    ,"matplot/matplot.dem.gateway.sce"];
+    _("Matplot")                     ,"matplot/matplot.dem.gateway.sce"];
 
     subdemolist(:,2) = demopath + subdemolist(:,2);
 endfunction
@@ -32,7 +32,7 @@ function demo_bar()
 
     angle = 295;
 
-    BackgroundColorId = color(205,253,203);
+    BackgroundColorId = color(225,253,223);
     year2005ColorId = color(238,222,12);
     year2006ColorId = color(255,0,0);
     year2007ColorId = color(64,155,59);
@@ -41,14 +41,11 @@ function demo_bar()
 
     drawlater();
     bar(x,y);
+    title("bar(''grouped'')", "fontsize", 3)
     histo = gce();
 
 
     // Adjustements
-    histogramme = gcf();
-    // histogramme.figure_size = [900,600];
-    histogramme.background = BackgroundColorId;
-
     axes = gca();
     axes.background = BackgroundColorId;
     axes.x_ticks.labels = ["Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"];
@@ -5,21 +5,21 @@
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
 
-function demo_basic_function7()
+function demo_custom_bars()
 
     mode(-1);
 
     my_handle             = scf(100001);
     clf(my_handle,"reset");
-    demo_viewCode("basic_functions_7.dem.sce");
+    demo_viewCode("bars_custom.dem.sce");
 
-    my_plot_desc          = "colored histogram";
+    my_plot_desc          = "Custom bars";
     my_handle.figure_name = my_plot_desc;
 
     expr=[
     "plot2d(0,0,[0],''012'',''leg'',[0,0,30,20]);"
     "a=gca(); t=a.title;"
-    "t.text=""colored histogram""; t.font_size=3;"
+    "t.text=""Custom bars""; t.font_size=3;"
     "a.clip_state = ''clipgrf'';"
     "x=[1 3 3 1 1]'';"
     "y=[0 0 1 1 0]'';"
@@ -32,5 +32,5 @@ function demo_basic_function7()
 
 endfunction
 
-demo_basic_function7();
-clear demo_basic_function7;
+demo_custom_bars();
+clear demo_custom_bars;
diff --git a/scilab/modules/graphics/demos/hist_bar_stem/histBarStem.dem.gateway.sce b/scilab/modules/graphics/demos/hist_bar_stem/histBarStem.dem.gateway.sce
new file mode 100644 (file)
index 0000000..1aab866
--- /dev/null
@@ -0,0 +1,23 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2018 - Samuel GOUGEON
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+demopath = get_absolute_file_path("histBarStem.dem.gateway.sce");
+
+subdemolist=[
+    _("Stems (plot2d3)")     , "plot2d3.dem.sce"
+    _("Bars (custom)")       , "bars_custom.dem.sce"
+    _("Bars (grouped)")      , "bar.dem.sce"
+    _("histplot")            , "histplot.dem.sce"
+    _("hist3d")              , "hist3d.dem.sce"
+    ];
+
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
+clear demopath;
@@ -1,6 +1,7 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2007-2008 - INRIA
 // Copyright (C) 2010 - DIGITEO - Allan CORNET
+// Copyright (C) 2018 - Samuel GOUGEON
 //
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
@@ -12,18 +13,28 @@ function demo_plot2d3()
 
     // DEMO START
 
-    my_plot_desc          = "plot2d3 (vbar plot)";
+    my_plot_desc          = "plot2d3 (stems)";
     my_handle.figure_name = my_plot_desc;
 
     n = 32-1;
     t = (0:n)/n;
     u = sin(80*%pi*t)+sin(100*%pi*t);
 
+    drawlater
     plot2d3("enn",1,abs(fft(u,-1))'/n);
-    xtitle(my_plot_desc,"t","f(t)");
+    xgrid(color("gold"),1,8);
+    xtitle("","t","f(t)");
+    title(my_plot_desc, "fontsize",3)
+    curve = gca().children.children;
 
-    // DEMO END
+    set(curve, "foreground", color("limegreen"), "thickness", 1.5);
+    curve.mark_mode = "on";
+    set(curve, "mark_foreground", color("orange"), "mark_style", 10, "mark_size", 1);
+    set(curve, "mark_stride", 2, "mark_offset", 1);
+
+    drawnow
 
+    // DEMO END
 endfunction
 
 demo_plot2d3();