* Bug #13965 fixed - The rendering of histograms with histplot() was poor 88/17888/3
Nicolas [Thu, 10 Mar 2016 13:38:33 +0000 (14:38 +0100)]
Change-Id: I86c39f3dac8205549bc570ff0b95b0c0b7424f59

14 files changed:
scilab/CHANGES
scilab/modules/graphics/macros/histplot.sci
scilab/modules/helptools/images/histplot_1.png
scilab/modules/helptools/images/histplot_en_US_2.png
scilab/modules/helptools/images/histplot_en_US_3.png
scilab/modules/helptools/images/histplot_en_US_4.png
scilab/modules/helptools/images/histplot_fr_FR_2.png
scilab/modules/helptools/images/histplot_fr_FR_3.png
scilab/modules/helptools/images/histplot_ja_JP_2.png
scilab/modules/helptools/images/histplot_ja_JP_3.png
scilab/modules/helptools/images/histplot_ja_JP_4.png
scilab/modules/helptools/images/histplot_ru_RU_2.png
scilab/modules/helptools/images/histplot_ru_RU_3.png
scilab/modules/helptools/images/histplot_ru_RU_4.png

index 43eab89..1a4364a 100644 (file)
@@ -315,6 +315,8 @@ In 6.0.0:
 
 * Bug #13869 fixed - bench_run with option nb_run=10 did not override the NB RUN tags
 
+* Bug #13965 fixed - The rendering of histograms with histplot() was poor
+
 * Bug #13974 fixed - isoview(xmin, xmax, ymin, ymax) was unhandy.
 
 * Bug #14035 fixed - ndgrid did not manage all homogeneous data type (booleans, integers, polynomials, rationals, strings, [])
index f559922..13cfe89 100644 (file)
@@ -5,6 +5,7 @@
 // Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
 // Copyright (C) 2013 - A. Khorshidi (new option)
 // Copyright (C) 2013 - Scilab Enterpriss - Paul Bignier: added output
+// Copyright (C) 2016 - Samuel GOUGEON
 //
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
 //
@@ -15,7 +16,6 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-
 function [y, ind] = histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,axesflag,normalization,polygon)
     // histplot(n,data,<opt_arg_seq>)
     // draws histogram of entries in  data put into n classes
@@ -49,6 +49,7 @@ function [y, ind] = histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,ax
     //    - modify a little the demo
     //    - add some checking on n|x and data
     //
+
     [lhs, rhs] = argn()
 
     y = [];
@@ -78,18 +79,17 @@ function [y, ind] = histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,ax
     end
 
     // This is the only specific optional argument for histplot
-    if ~exists("normalization","local") then, normalization=%t,end
-    if ~exists("polygon","local") then, polygon=%f,end
+    if exists("normalization","l")==0, normalization=%t,end
+    if exists("polygon","l")==0, polygon=%f,end
 
     // Now parse optional arguments to be sent to plot2d
-    opt_arg_seq = []
+    opt_arg_seq = "";
     opt_arg_list = ["style","strf","leg","rect","nax","logflag","frameflag","axesflag"]
     for opt_arg = opt_arg_list
         if exists(opt_arg,"local") then
             opt_arg_seq = opt_arg_seq +","+ opt_arg + "=" + opt_arg
         end
     end
-
     [y, ind] = histc(n, data, normalization);
 
     if length(n) == 1 then  // The number of classes is provided
@@ -122,5 +122,16 @@ function [y, ind] = histplot(n,data,style,strf,leg,rect,nax,logflag,frameflag,ax
         execstr("plot2d(X,Y"+opt_arg_seq+")")
         if polygon then plot(xp,yp,"r-o"), end // new line
     end
-
+    e = gca();
+    if polygon then
+        e = e.children(2).children
+    else
+        e = e.children(1).children
+    end
+    e.fill_mode = "on";
+    e.data(:,3) = -0.1;  // unmask the x-axis
+    c = e.foreground;
+    f = gcf();
+    c = f.color_map(max(1,c),:)
+    e.background = addcolor(1-(1-c)/20); // default filling color = edges one but fainter
 endfunction
index 284ae27..e038b9d 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_1.png and b/scilab/modules/helptools/images/histplot_1.png differ
index 27498c2..4f0f199 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_en_US_2.png and b/scilab/modules/helptools/images/histplot_en_US_2.png differ
index 55fb2e3..8bd7df2 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_en_US_3.png and b/scilab/modules/helptools/images/histplot_en_US_3.png differ
index 317cd6a..5188923 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_en_US_4.png and b/scilab/modules/helptools/images/histplot_en_US_4.png differ
index 631d74c..c925345 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_fr_FR_2.png and b/scilab/modules/helptools/images/histplot_fr_FR_2.png differ
index ad3e476..3873229 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_fr_FR_3.png and b/scilab/modules/helptools/images/histplot_fr_FR_3.png differ
index 933c47b..4f0f199 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ja_JP_2.png and b/scilab/modules/helptools/images/histplot_ja_JP_2.png differ
index 11cd4bd..8bd7df2 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ja_JP_3.png and b/scilab/modules/helptools/images/histplot_ja_JP_3.png differ
index 9b5d3bd..5188923 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ja_JP_4.png and b/scilab/modules/helptools/images/histplot_ja_JP_4.png differ
index c2cb7d8..4f0f199 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ru_RU_2.png and b/scilab/modules/helptools/images/histplot_ru_RU_2.png differ
index 22c2cbc..8bd7df2 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ru_RU_3.png and b/scilab/modules/helptools/images/histplot_ru_RU_3.png differ
index ff47d98..5188923 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_ru_RU_4.png and b/scilab/modules/helptools/images/histplot_ru_RU_4.png differ