* Bug 14906 fixed: histc & histplot normalization was broken 72/20472/5
Samuel GOUGEON [Fri, 24 Aug 2018 18:20:55 +0000 (20:20 +0200)]
  http://bugzilla.scilab.org/13490
  http://bugzilla.scilab.org/14906

  This bug hinders teachers & students (see http://bugzilla.scilab.org/15128)
  We must not wait for the hist() and histplot() refactoring for 6.1
  to fix it.

  * histc() (and so histplot) normalization fixed.
  * histc page:
    - syntaxes unfolded
    - ind => undocumented (very badly placed. classes expected in argout#2)
    - cf renamed h. h and normalization decsriptions fixed.
    - examples:
      - sum checking added in example #1
      - ; added after histc() to prevent displaying values flowing in the console
  * histplot page:
     - syntaxes unfolded
     - ind undocumented
      - ; added after histplot() to prevent displaying values in console

Change-Id: I8f13521cbc62bfa52534099dfd8faf34df9adc0d

59 files changed:
scilab/CHANGES.md
scilab/modules/elementary_functions/help/en_US/elementarymatrices/grand.xml
scilab/modules/elementary_functions/help/fr_FR/elementarymatrices/grand.xml
scilab/modules/elementary_functions/help/ru_RU/elementarymatrices/grand.xml
scilab/modules/graphics/help/en_US/2d_plot/histplot.xml
scilab/modules/graphics/help/fr_FR/2d_plot/histplot.xml
scilab/modules/graphics/help/ja_JP/2d_plot/histplot.xml
scilab/modules/graphics/help/pt_BR/2d_plot/histplot.xml
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/Graphics_15.png
scilab/modules/helptools/images/grand_en_US_1.png
scilab/modules/helptools/images/grand_en_US_2.png
scilab/modules/helptools/images/grand_en_US_3.png
scilab/modules/helptools/images/grand_en_US_4.png
scilab/modules/helptools/images/grand_fr_FR_1.png
scilab/modules/helptools/images/grand_fr_FR_2.png
scilab/modules/helptools/images/grand_fr_FR_3.png
scilab/modules/helptools/images/grand_fr_FR_4.png
scilab/modules/helptools/images/grand_pt_BR_1.png
scilab/modules/helptools/images/grand_pt_BR_2.png
scilab/modules/helptools/images/grand_pt_BR_3.png
scilab/modules/helptools/images/grand_pt_BR_4.png
scilab/modules/helptools/images/grand_ru_RU_1.png
scilab/modules/helptools/images/grand_ru_RU_2.png
scilab/modules/helptools/images/grand_ru_RU_3.png
scilab/modules/helptools/images/grand_ru_RU_4.png
scilab/modules/helptools/images/histc_en_US_2.png
scilab/modules/helptools/images/histc_en_US_3.png
scilab/modules/helptools/images/histc_en_US_4.png
scilab/modules/helptools/images/histc_fr_FR_2.png
scilab/modules/helptools/images/histc_fr_FR_3.png
scilab/modules/helptools/images/histc_fr_FR_4.png
scilab/modules/helptools/images/histc_ja_JP_2.png
scilab/modules/helptools/images/histc_ja_JP_3.png
scilab/modules/helptools/images/histc_ja_JP_4.png
scilab/modules/helptools/images/histc_pt_BR_2.png
scilab/modules/helptools/images/histc_pt_BR_3.png
scilab/modules/helptools/images/histc_pt_BR_4.png
scilab/modules/helptools/images/histc_ru_RU_2.png
scilab/modules/helptools/images/histc_ru_RU_3.png
scilab/modules/helptools/images/histc_ru_RU_4.png
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_fr_FR_4.png [new file with mode: 0644]
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
scilab/modules/helptools/images/xsetech_1.png
scilab/modules/statistics/help/en_US/descriptive_statistics/histc.xml
scilab/modules/statistics/help/fr_FR/descriptive_statistics/histc.xml
scilab/modules/statistics/help/ja_JP/descriptive_statistics/histc.xml
scilab/modules/statistics/macros/histc.sci

index 4a4cf62..bea2a29 100644 (file)
@@ -460,6 +460,7 @@ Known issues
 * [#13039](http://bugzilla.scilab.org/show_bug.cgi?id=13039): In Scinotes, the "File => Save file in" action opened the parent of the targeted directory.
 * [#13466](http://bugzilla.scilab.org/show_bug.cgi?id=13466): Since Scilab 5.5.0, it was no longer possible to dock the demo GUI.
 * [#13480](http://bugzilla.scilab.org/show_bug.cgi?id=13480): The default k value of `eigs` was wrong and made `eigs` failing for small full matrices.
+* [#13490](http://bugzilla.scilab.org/show_bug.cgi?id=13490): `histc` normalization was wrong. In the help, its description was wrong and inconsistent.
 * [#13522](http://bugzilla.scilab.org/show_bug.cgi?id=13522): `savematfile` failed saving numerical hypermatrices.
 * [#13632](http://bugzilla.scilab.org/show_bug.cgi?id=13632): The syntax `savematfile(filename, varnames)` was not documented. Other information was missing in the page.
 * [#13778](http://bugzilla.scilab.org/show_bug.cgi?id=13778): The size of `repmat([], [1 1 3])` was [0 0 3] instead of [0 0].
@@ -486,6 +487,7 @@ Known issues
 * [#14708](http://bugzilla.scilab.org/show_bug.cgi?id=14708): polynomial operators `+` `-` `/` `./` `*` `.*` no longer simplified null high orders coefficients from result
 * [#14840](http://bugzilla.scilab.org/show_bug.cgi?id=14840): `load()` is unable to load old data files saved with Scilab < 5.4.0 out of the SOD format.
 * [#14897](http://bugzilla.scilab.org/show_bug.cgi?id=14897): `xinfo` is poor and useless. It is declared obsolete.
+* [#14906](http://bugzilla.scilab.org/show_bug.cgi?id=14906): The `histplot` normalization was broken.
 * [#14915](http://bugzilla.scilab.org/show_bug.cgi?id=14915): `ascii(10)` makes `mprintf()` stop printing (REGRESSION).
 * [#14988](http://bugzilla.scilab.org/show_bug.cgi?id=14988): The example of Xcos diagram on the DERIV help page was distorted.
 * [#14989](http://bugzilla.scilab.org/show_bug.cgi?id=14989): The example of Xcos diagram on the INTEGRAL_m help page was distorted.
index 246339b..1dd350d 100644 (file)
@@ -837,7 +837,7 @@ N=100000;
 X = grand(1,N,"exp",lambda);
 scf();
 classes = linspace(0,12,25);
-histplot(classes,X)
+histplot(classes,X);
 x=linspace(0,12,25);
 y = (1/lambda)*exp(-(1/lambda)*x);
 plot(x,y,"ro-");
index c9dd6ef..77c5959 100644 (file)
@@ -805,7 +805,7 @@ N = 100000;
 X = grand(1, N, "exp", lambda);
 scf();
 classes = linspace(0, 12, 25);
-histplot(classes, X)
+histplot(classes, X);
 x = linspace(0, 12, 25);
 y = (1/lambda)*exp(-(1/lambda)*x);
 plot(x, y, "ro-");
index 114f809..565a9ee 100644 (file)
@@ -839,7 +839,7 @@ N=100000;
 X = grand(1,N,"exp",lambda);
 scf();
 classes = linspace(0,12,25);
-histplot(classes,X)
+histplot(classes,X);
 x=linspace(0,12,25);
 y = (1/lambda)*exp(-(1/lambda)*x);
 plot(x,y,"ro-");
index 9d9d830..607fc25 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added data output
  * Copyright (C) INRIA - Serge Steer
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * along with this program.
  *
  --><!-- This document was created with Syntext Serna Free. -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="histplot">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="en" xml:id="histplot">
     <refnamediv>
         <refname>histplot</refname>
         <refpurpose>plot a histogram</refpurpose>
@@ -22,8 +25,9 @@
     <refsynopsisdiv>
         <title>Syntax</title>
         <synopsis>
-            [cf, ind] = histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
-            [cf, ind] = histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            cf = histplot(..)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
             <varlistentry>
                 <term>cf</term>
                 <listitem>
-                    <para>
-                        This represents a sequence of statements <literal>key1=value1,key2=value2</literal>
-                        ,... where <literal>key1</literal>,
-                        <literal>key2,...</literal> can be any optional <link linkend="plot2d">plot2d</link> parameter (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag </literal>
-                        ).
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>ind</term>
-                <listitem>
-                    <para>
-                        This represents a sequence of statements <literal>key1=value1,key2=value2</literal>
-                        ,... where <literal>key1</literal>,
-                        <literal>key2,...</literal> can be any optional <link linkend="plot2d">plot2d</link> parameter (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag </literal>
-                        ).
+                    <para>Computed frequencies (bins heighs)
                     </para>
                 </listitem>
             </varlistentry>
     </refsection>
     <refsection>
         <title>Examples</title>
-        <simplelist>
-            <member> Example #1: variations around a histogram of a gaussian random sample
-                <programlisting role="example"><![CDATA[
-d=rand(1,10000,'normal');  // the gaussian random sample
-clf(); histplot(20,d)
-clf(); histplot(20,d,normalization=%f)
-clf(); histplot(20,d,leg='rand(1,10000,''normal'')',style=5)
+            <para>
+                <emphasis role="bold">Example #1</emphasis>:
+                variations around a histogram of a gaussian random sample
+            </para>
+            <programlisting role="example"><![CDATA[
+d = rand(1,10000,'normal');  // the gaussian random sample
+
+clf(); histplot(20,d);
+clf(); histplot(20,d,normalization=%f);
+clf(); histplot(20,d,leg='rand(1,10000,''normal'')',style=5);
 clf(); histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
 ]]></programlisting>
                 <scilab:image>
                     d=rand(1,10000,'normal');
                     clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
                 </scilab:image>
-            </member>
-            <member>
-                Example #2: histogram of a binomial (B(6,0.5)) random sample
-                <programlisting role="example"><![CDATA[
+            <para/>
+            <para>
+                <emphasis role="bold">Example #2</emphasis>:
+                histogram of a binomial (B(6,0.5)) random sample
+            </para>
+            <programlisting role="example"><![CDATA[
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
+
 clf()
 subplot(2,1,1)
-histplot(c, d, style=2)
+histplot(c, d, style=2);
 xtitle("Normalized histogram")
+
 subplot(2,1,2)
-histplot(c, d, normalization=%f, style=5)
+histplot(c, d, normalization=%f, style=5);
 xtitle("Non normalized histogram")
 ]]></programlisting>
                 <scilab:image localized="true">
@@ -178,46 +174,50 @@ xtitle("Non normalized histogram")
                     histplot(c, d, normalization=%f, style=5)
                     xtitle("non normalized histogram")
                 </scilab:image>
-            </member>
-            <member>
-                Example #3: histogram of an exponential random sample
-                <programlisting role="example"><![CDATA[
+            <para/>
+            <para>
+                <emphasis role="bold">Example #3</emphasis>:
+                histogram of an exponential random sample
+            </para>
+            <programlisting role="example"><![CDATA[
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
+
 clf()
-histplot(40, X, style=2)
+histplot(40, X, style=2);
 x = linspace(0,max(Xmax),100)';
 plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
 legend(["exponential random sample histogram" "exact density curve"]);
 ]]></programlisting>
-                <scilab:image localized="true">
-                    lambda = 2;
-                    X = grand(100000,1,"exp", 1/lambda);
-                    Xmax = max(X);
-                    clf()
-                    histplot(40, X, style=2)
-                    x = linspace(0,max(Xmax),100)';
-                    plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
-                    legend(["exponential random sample histogram" "exact density curve"]);
-                </scilab:image>
-            </member>
-            <member>
-                Example #4: the frequency polygon chart and the histogram of a gaussian random sample
-                <programlisting role="example"><![CDATA[
-n=10;
-data=rand(1,1000,"normal");
+            <scilab:image localized="true">
+                lambda = 2;
+                X = grand(100000,1,"exp", 1/lambda);
+                Xmax = max(X);
+                clf()
+                histplot(40, X, style=2)
+                x = linspace(0,max(Xmax),100)';
+                plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
+                legend(["exponential random sample histogram" "exact density curve"]);
+            </scilab:image>
+            <para/>
+            <para>
+                <emphasis role="bold">Example #4</emphasis>:
+                the frequency polygon chart and the histogram of a gaussian random sample
+            </para>
+            <programlisting role="example"><![CDATA[
+n = 10;
+data = rand(1,1000,"normal");
+
 clf(); histplot(n, data, style=12, polygon=%t);
-legend(["normalized histogram" "frequency polygon chart"]);
+legend(["normalized histogram" "frequency polygon chart"],"lower_caption");
 ]]></programlisting>
-                <scilab:image localized="true">
-                    n=10;
-                    data=rand(1,1000,"normal");
-                    clf(); histplot(n,data,style=12,polygon=%t);
-                    legend(["normalized histogram" "frequency polygon chart"]);
-                </scilab:image>
-            </member>
-        </simplelist>
+            <scilab:image localized="true">
+                n=10;
+                data=rand(1,1000,"normal");
+                clf(); histplot(n,data,style=12,polygon=%t);
+                legend(["normalized histogram" "frequency polygon chart"],"lower_caption");
+            </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
@@ -239,4 +239,15 @@ legend(["normalized histogram" "frequency polygon chart"]);
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revdescription>
+                    <literal>polygon</literal> option and <literal>cf</literal> output added.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index ad16960..9aeaf25 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: ajout de la sortie
  * Copyright (C) INRIA - Serge Steer
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * For more information, see the COPYING file which you should have received
  * along with this program.
  *
- --><!-- This document was created with Syntext Serna Free. -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="histplot">
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="fr" xml:id="histplot">
     <refnamediv>
         <refname>histplot</refname>
         <refpurpose>dessine un histogramme</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Séquence d'appel</title>
+        <title>Syntaxe</title>
         <synopsis>
-            [cf, ind] = histplot(n, data, &lt;opt_args&gt;)
-            [cf, ind] = histplot(x, data, &lt;opt_args&gt;)
+            histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            cf = histplot(..)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Paramètres</title>
+        <title>Arguments</title>
         <variablelist>
             <varlistentry>
                 <term>n</term>
                 <term>&lt;opt_args&gt;</term>
                 <listitem>
                     <para>
-                        Représente une séquence de la forme <literal>clé1=valeur1,
-                            clé2=valeur2
-                        </literal>
-                        ,... où <literal>clé1</literal>,
-                        <literal>clé2,...</literal> peut être n'importe quel paramètre optionnel de <link linkend="plot2d">plot2d</link>
-                        (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag</literal>) ou encore <literal>normalization</literal>.
+                        Représente une séquence de la forme
+                        <literal>clé1=valeur1, clé2=valeur2</literal>,... où <literal>clé1</literal>,
+                        <literal>clé2,...</literal> peut être n'importe quel paramètre optionnel de
+                        <link linkend="plot2d">plot2d</link>
+                        (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag</literal>)
+                        ou encore <literal>normalization</literal>.
                         Pour ce dernier la valeur correspondante est un scalaire booléen
                         (la valeur par défaut étant %t).
                     </para>
                 </listitem>
             </varlistentry>
+            <varlistentry>
+                <term>cf</term>
+                <listitem>
+                    <para>Fréquences calculées (hauteurs de l'histogramme)
+                    </para>
+                </listitem>
+            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
     </refsection>
     <refsection>
         <title>Exemples</title>
-        <simplelist>
-            <member>
-                Exemple #1: variations sur l'histogramme d'un échantillon gaussien N(0,1)
-                <programlisting role="example"><![CDATA[
-d=rand(1,10000,'normal');
-clf();histplot(20,d)
-clf();histplot(20,d,normalization=%f)
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=5)
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
-]]></programlisting>
-                <scilab:image>
-                    d=rand(1,10000,'normal');
-                    clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
-                </scilab:image>
-            </member>
-            <member>
-                Exemple #2: histogramme d'un échantillon de loi binomiale B(6,0.5)
-                <programlisting role="example"><![CDATA[
+            <para>
+                <emphasis role="bold">Exemple n°1</emphasis> :
+                variations sur l'histogramme d'un échantillon gaussien N(0,1)
+            </para>
+            <programlisting role="example"><![CDATA[
+d = rand(1,10000,'normal');
+
+clf(); histplot(20,d);
+clf(); histplot(20,d,normalization=%f);
+clf(); histplot(20,d,leg='rand(1,10000,''normal'')',style=5);
+clf(); histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
+        ]]></programlisting>
+            <scilab:image>
+                d=rand(1,10000,'normal');
+                clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
+            </scilab:image>
+            <para/>
+            <para>
+                <emphasis role="bold">Exemple n°2</emphasis> :
+                histogramme d'un échantillon de loi binomiale B(6,0.5)
+            </para>
+            <programlisting role="example"><![CDATA[
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
+
 clf()
 subplot(2,1,1)
-[cf, ind] = histplot(c, d, style=2)
+histplot(c, d, style=2);
 xtitle("l''histogramme normalisé")
+
 subplot(2,1,2)
-[cf, ind] = histplot(c, d, normalization=%f, style=5)
+histplot(c, d, normalization=%f, style=5);
 xtitle("l''histogramme non normalisé")
-]]></programlisting>
-                <scilab:image localized="true">
-                    d = grand(1000,1,"bin", 6, 0.5);
-                    c = linspace(-0.5,6.5,8);
-                    clf()
-                    subplot(2,1,1)
-                    histplot(c, d, style=2)
-                    xtitle("l''histogramme normalisé")
-                    subplot(2,1,2)
-                    histplot(c, d, normalization=%f, style=5)
-                    xtitle("l''histogramme non normalisé")
-                </scilab:image>
-            </member>
-            <member>
-                Exemple #3: histogramme d'un échantillon de loi exponentielle E(lambda)
-                <programlisting role="example"><![CDATA[
+        ]]></programlisting>
+            <scilab:image localized="true">
+                d = grand(1000,1,"bin", 6, 0.5);
+                c = linspace(-0.5,6.5,8);
+                clf()
+                subplot(2,1,1)
+                histplot(c, d, style=2)
+                xtitle("l''histogramme normalisé")
+                subplot(2,1,2)
+                histplot(c, d, normalization=%f, style=5)
+                xtitle("l''histogramme non normalisé")
+            </scilab:image>
+            <para/>
+            <para>
+                <emphasis role="bold">Exemple n°3</emphasis> :
+                histogramme d'un échantillon de loi exponentielle E(lambda)
+            </para>
+            <programlisting role="example"><![CDATA[
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
+
 clf()
-histplot(40, X, style=2)
+histplot(40, X, style=2);
 x = linspace(0,max(Xmax),100)';
 plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
 legend(["histogramme d''un échantillon E(lambda)" "densité exacte"]);
-]]></programlisting>
-                <scilab:image localized="true">
-                    lambda = 2;
-                    X = grand(100000,1,"exp", 1/lambda);
-                    Xmax = max(X);
-                    clf()
-                    histplot(40, X, style=2)
-                    x = linspace(0,max(Xmax),100)';
-                    plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
-                    legend(["histogramme d''un échantillon E(lambda)" "densité exacte"]);
-                </scilab:image>
-            </member>
-        </simplelist>
+        ]]></programlisting>
+            <scilab:image localized="true">
+                lambda = 2;
+                X = grand(100000,1,"exp", 1/lambda);
+                Xmax = max(X);
+                clf()
+                histplot(40, X, style=2)
+                x = linspace(0,max(Xmax),100)';
+                plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
+                legend(["histogramme d''un échantillon E(lambda)" "densité exacte"]);
+            </scilab:image>
+            <para/>
+            <para>
+                <emphasis role="bold">Exemple n°4</emphasis> :
+                courbe des fréquences empiriques et histogramme d'un échantillon aléatoire gaussien.
+            </para>
+            <programlisting role="example"><![CDATA[
+n = 10;
+data = rand(1,1000,"normal");
+
+clf(); histplot(n, data, style=12, polygon=%t);
+legend(["Histogramme normalisé" "Courbe des fréquences"],"lower_caption");
+        ]]></programlisting>
+            <scilab:image localized="true">
+                n=10;
+                data=rand(1,1000,"normal");
+                clf(); histplot(n,data,style=12,polygon=%t);
+                legend(["Histogramme normalisé" "Courbe des fréquences"],"lower_caption");
+            </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>Voir aussi</title>
@@ -185,4 +221,15 @@ legend(["histogramme d''un échantillon E(lambda)" "densité exacte"]);
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revdescription>
+                    Ajout de l'option <literal>polygon</literal> et de la sortie <literal>cf</literal>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 6d551c6..040e729 100644 (file)
@@ -1,15 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
-
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-
+ * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: ajout de la sortie
  * Copyright (C) INRIA - Serge Steer
-
- *
-
-
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * and continues to be available under such terms.
  * For more information, see the COPYING file which you should have received
  * along with this program.
-
  *
-
  -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="ja" xml:id="histplot">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="ja" xml:id="histplot">
     <refnamediv>
-
         <refname>histplot</refname>
-
         <refpurpose>ヒストグラムをプロットする</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
         <synopsis>
-
-            [cf, ind] = histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
-
-            [cf, ind] = histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
-
+            histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            cf = histplot(..)
         </synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>n</term>
-
                 <listitem>
-
                     <para>正の整数 (クラスの数)</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>x</term>
-
                 <listitem>
-
                     <para>
-
                         クラスを定義する増加方向のベクトル (<literal>x</literal>は2個以上の要素を有します)
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>data</term>
-
                 <listitem>
-
                     <para>ベクトル (解析するデータ)</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>normalization</term>
-
                 <listitem>
-
                     <para>論理値 (%t (デフォルト値) または %f)</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>polygon</term>
-
                 <listitem>
-
                     <para>論理値 (%t または %f (デフォルト値))</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>&lt;opt_args&gt;</term>
-
                 <listitem>
-
                     <para>
-
                         一連の命令 <literal>key1=value1,key2=value2</literal>
-
                         ,... を表します.ただし,<literal>key1</literal>,
-
                         <literal>key2,...</literal> は任意の<link linkend="plot2d">plot2d</link> の
-
                         オプションのパラメータ
-
                         (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag </literal>)
-
                         とすることができます.
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>cf</term>
-
                 <listitem>
-
                     <para>
-
                         これは一連の命令 <literal>key1=value1,key2=value2</literal>,...を表します.
-
                         ただし, <literal>key1</literal>,
-
                         <literal>key2,...</literal> は,
-
                         <link linkend="plot2d">plot2d</link>の任意のオプションパラメータ
-
                         (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag </literal>)
-
                         とすることができます.
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
-                <term>ind</term>
-
+                <term>cf</term>
                 <listitem>
-
-                    <para>
-
-                        これは一連の命令<literal>key1=value1,key2=value2</literal>
-
-                        ,...を表します. ただし,<literal>key1</literal>,
-
-                        <literal>key2,...</literal> は,
-
-                        <link linkend="plot2d">plot2d</link>の任意のオプションパラメータ
-
-                        (<literal>style,strf,leg, rect,nax, logflag,frameflag, axesflag </literal>)
-
-                        とすることができます.
-
+                    <para>Computed frequencies (bins heighs)
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             この関数は,クラス<literal>x</literal>を用いて<literal>data</literal>ベクトル
-
             のヒストグラム(柱状グラフ)をプロットします.
-
             <literal>x</literal>のかわりにクラスの数<literal>n</literal>が指令された場合,
-
             クラスは等間隔で<emphasis>dx = (x(n+1)-x(1))/n</emphasis>として
-
             <emphasis>x(1) = min(data) &lt;  x(2) = x(1) + dx  &lt;  ...  &lt; x(n+1) = max(data)</emphasis>
-
             となるように選択されます.
-
         </para>
-
         <para>
-
             クラスはC1 = [x(1), x(2)]およびi &gt;= 2の時にCi = ( x(i), x(i+1)]
-
             により定義されます.
-
             <literal>data</literal>の総数 Nmax  (Nmax = length(data))となり,
-
             Ciに含まれる<literal>data</literal>要素の数 Niは
-
             <literal>normalization</literal>が true (デフォルト)の場合には
-
             <emphasis>Ni/(Nmax (x(i+1)-x(i)))</emphasis>となります.
-
             そうでない場合, <emphasis>Ni</emphasis> となります.
-
             正規化が行われる場合,このヒストグラムは以下の制約を満たします:
-
         </para>
-
         <para>
-
             <latex style="display"><![CDATA[ \int_{x(1)}^{x(n+1)}h(x)\,\mathrm{d}x=1 ]]></latex>
-
         </para>
-
         <para>
-
             任意の <link linkend="plot2d">plot2d</link> (オプション) パラメータを指定できます;
-
             例えば,色番号2 (標準カラーマップを使用する場合には青)のヒストグラムをプロットする場合や,
-
             矩形 [-3,3]x[0,0.5] の内側へのプロットを制限する場合,
-
             <literal>histplot(n,data, style=2, rect=[-3,0,3,0.5])</literal>
-
             を使用することができます.
-
         </para>
-
         <para>
-
             周波数ポリゴンは,ヒストグラムの全てのビンの頂部の中点をつなぐことにより描画されるグラフn
-
             線です.
-
             このため, ポリゴン周波数チャートをプロットするために
-
             <literal>histplot</literal> を使用できます.
-
         </para>
-
         <para>
-
             オプションの引数 <literal>polygon</literal> は,直線を有するヒストグラムの
-
             各バーの頂部の中点を接続します.
-
         </para>
-
         <para>
-
             <literal>polygon=%t</literal>の場合,
-
             周波数ポリゴンチャート付きのヒストグラムが出力されます.
-
         </para>
-
         <para>
-
             デモを参照するには <literal>histplot()</literal>コマンドを入力してください.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <simplelist>
-
             <member>
-
                 例 #1: ガウス乱数標本の種々のヒストグラム
-
                 <programlisting role="example"><![CDATA[
+d = rand(1,10000,'normal');  // ガウス乱数標本
 
-d=rand(1,10000,'normal');  // ガウス乱数標本
-
-clf();histplot(20,d)
-
-clf();histplot(20,d,normalization=%f)
-
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=5)
-
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
-
+clf(); histplot(20, d);
+clf(); histplot(20, d, normalization=%f);
+clf(); histplot(20, d, leg='rand(1,10000,''normal'')', style=5);
+clf(); histplot(20, d, leg='rand(1,10000,''normal'')', style=16, rect=[-3,0,3,0.5]);
 ]]></programlisting>
-
                 <scilab:image>
-
                     d=rand(1,10000,'normal');
-
                     clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
-
                 </scilab:image>
-
             </member>
-
             <member>
-
                 例 #2: 二項分布 (B(6,0.5)) 乱数標本のヒストグラム
-
                 <programlisting role="example"><![CDATA[
-
 d = grand(1000,1,"bin", 6, 0.5);
-
 c = linspace(-0.5,6.5,8);
 
 clf()
-
 subplot(2,1,1)
-
-histplot(c, d, style=2)
-
+histplot(c, d, style=2);
 xtitle("normalized histogram")
 
 subplot(2,1,2)
-
-histplot(c, d, normalization=%f, style=5)
-
+histplot(c, d, normalization=%f, style=5);
 xtitle("non normalized histogram")
-
 ]]></programlisting>
-
                 <scilab:image localized="true">
-
                     d = grand(1000,1,"bin", 6, 0.5);
-
                     c = linspace(-0.5,6.5,8);
-
                     clf()
-
                     subplot(2,1,1)
-
                     histplot(c, d, style=2)
-
                     xtitle("normalized histogram")
-
                     subplot(2,1,2)
-
                     histplot(c, d, normalization=%f, style=5)
-
                     xtitle("non normalized histogram")
-
                 </scilab:image>
-
             </member>
-
             <member>
-
                 例 #3: 指数乱数標本のヒストグラム
-
                 <programlisting role="example"><![CDATA[
-
 lambda = 2;
-
 X = grand(100000,1,"exp", 1/lambda);
-
 Xmax = max(X);
 
 clf()
-
-histplot(40, X, style=2)
-
+histplot(40, X, style=2);
 x = linspace(0,max(Xmax),100)';
-
 plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
-
 legend(["exponential random sample histogram" "exact density curve"]);
-
 ]]></programlisting>
-
                 <scilab:image localized="true">
-
                     lambda = 2;
-
                     X = grand(100000,1,"exp", 1/lambda);
-
                     Xmax = max(X);
-
                     clf()
-
                     histplot(40, X, style=2)
-
                     x = linspace(0,max(Xmax),100)';
-
                     plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
-
                     legend(["exponential random sample histogram" "exact density curve"]);
-
                 </scilab:image>
-
             </member>
-
             <member>
-
                 例 #4: 周波数ポリゴンチャートおよびガウス乱数標本のヒストグラム
-
                 <programlisting role="example"><![CDATA[
-
-n=10;
-
-data=rand(1,1000,"normal");
+n = 10;
+data = rand(1,1000,"normal");
 
 clf(); histplot(n, data, style=12, polygon=%t);
-
-legend(["normalized histogram" "frequency polygon chart"]);
-
+legend(["normalized histogram" "frequency polygon chart"],"lower_caption");
 ]]></programlisting>
-
                 <scilab:image localized="true">
-
                     n=10;
-
                     data=rand(1,1000,"normal");
-
                     clf(); histplot(n,data,style=12,polygon=%t);
-
-                    legend(["normalized histogram" "frequency polygon chart"]);
-
+                    legend(["normalized histogram" "frequency polygon chart"],"lower_caption");
                 </scilab:image>
-
             </member>
-
         </simplelist>
-
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
                 <link linkend="histc">histc</link>
-
             </member>
-
             <member>
-
                 <link linkend="hist3d">hist3d</link>
-
             </member>
-
             <member>
-
                 <link linkend="plot2d">plot2d</link>
-
             </member>
-
             <member>
-
                 <link linkend="bar">bar</link>
-
             </member>
-
             <member>
-
                 <link linkend="dsearch">dsearch</link>
-
             </member>
-
         </simplelist>
-
     </refsection>
-
-</refentry>
-
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revdescription>
+                    <literal>polygon</literal> option and <literal>cf</literal> output added.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index 77b2731..516dfcf 100644 (file)
@@ -1,9 +1,10 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: ajout de la sortie
  * Copyright (C) INRIA - Serge Steer
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="histplot" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+        xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+        xmlns:scilab="http://www.scilab.org" xml:id="histplot" xml:lang="pt">
     <refnamediv>
         <refname>histplot</refname>
-        <refpurpose>esboça um histograma</refpurpose>
+        <refpurpose>esboça um histograma</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>histplot(n, data, &lt;opt_args&gt;)
-            histplot(x, data, &lt;opt_args&gt;)
+        <title>Seqüência de Chamamento</title>
+        <synopsis>
+            histplot(n, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            histplot(x, data [,normalization] [,polygon], &lt;opt_args&gt;)
+            cf = histplot(..)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Parâmetros</title>
+        <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
                 <term>n</term>
                 <listitem>
-                    <para>inteiro positivo (número de classes) </para>
+                    <para>inteiro positivo (número de classes) </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
             <varlistentry>
                 <term>&lt;opt_args&gt;</term>
                 <listitem>
-                    <para>representa uma seqüência de declarações
+                    <para>representa uma seqüência de declarações
                         <literal>key1=value1,key2=value2</literal> ,... onde
                         <literal>key1</literal>, <literal>key2,...</literal> pode ser
-                        qualquer normalização ou parâmetro de <link linkend="plot2d">plot2d</link> opcional (<literal>style,strf,leg,
+                        qualquer normalização ou parâmetro de <link linkend="plot2d">plot2d</link> opcional (<literal>style,strf,leg,
                             rect,nax, logflag,frameflag, axesflag
                         </literal>
                         )No caso de
-                        normalização, o valor correspondente deve ser um escalar booleano
-                        (valor padrão %t).
+                        normalização, o valor correspondente deve ser um escalar booleano
+                        (valor padrão %t).
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>cf</term>
+                <listitem>
+                    <para>Computed frequencies (bins heighs)
                     </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
-        <title>Descrição</title>
+        <title>Descrição</title>
         <para>
-            Esta função esboça um histograma do vetor <literal>data</literal>
-            utilizando classes <literal>x</literal>. Quando o número
-            <literal>n</literal> de classes é fornecido ao invés de
-            <literal>x</literal>, as classes são escolhidas de modo igualmente
-            espaçado e <emphasis>x(1) = min(data) &lt; x(2) = x(1) + dx &lt; ... &lt;
+            Esta função esboça um histograma do vetor <literal>data</literal>
+            utilizando classes <literal>x</literal>. Quando o número
+            <literal>n</literal> de classes é fornecido ao invés de
+            <literal>x</literal>, as classes são escolhidas de modo igualmente
+            espaçado e <emphasis>x(1) = min(data) &lt; x(2) = x(1) + dx &lt; ... &lt;
                 x(n+1) = max(data)
             </emphasis>
             com <emphasis>dx =
             </emphasis>
             .
         </para>
-        <para>As classes são definidas por C1 = [x(1), x(2)] e Ci = ( x(i),
-            x(i+1)] para i &gt;= 2. Notando Nmax o número total de
-            <literal>data</literal> (Nmax = comprimento de data) e Ni o número de
+        <para>As classes são definidas por C1 = [x(1), x(2)] e Ci = ( x(i),
+            x(i+1)] para i &gt;= 2. Notando Nmax o número total de
+            <literal>data</literal> (Nmax = comprimento de data) e Ni o número de
             componentes de <literal>data</literal> em Ci, o valor do histograma para x
-            em Ci é igual a <emphasis>Ni/(Nmax (x(i+1)-x(i)))</emphasis> quando
-            <literal>normalization</literal> (normalização) for verdadeiro (caso
-            padrão) senão, é simplesmente igual a Ni. Quando a normalização ocorre, o
+            em Ci é igual a <emphasis>Ni/(Nmax (x(i+1)-x(i)))</emphasis> quando
+            <literal>normalization</literal> (normalização) for verdadeiro (caso
+            padrão) senão, é simplesmente igual a Ni. Quando a normalização ocorre, o
             histograma verifica:
         </para>
         <para>
             quando <emphasis>x(1)&lt;=min(data)</emphasis> e <emphasis>max(data) &lt;= x(n+1)</emphasis>
         </para>
         <para>
-            Qualquer <link linkend="plot2d">plot2d</link> parâmetro (opcional)
-            pode ser fornecido; por exemplo, para esboçar um histograma com a cor
-            número 2 (azul, se o mapa de cores padrão for utilizado) e para restringir
-            o esboço ao retângulo [-3,3]x[0,0.5], você pode utilizar
+            Qualquer <link linkend="plot2d">plot2d</link> parâmetro (opcional)
+            pode ser fornecido; por exemplo, para esboçar um histograma com a cor
+            número 2 (azul, se o mapa de cores padrão for utilizado) e para restringir
+            o esboço ao retângulo [-3,3]x[0,0.5], você pode utilizar
             <literal>histplot(n,data, style=2, rect=[-3,0,3,0.5])</literal>.
         </para>
         <para>
             Entre com o comando <literal>histplot()</literal> para visualizar
-            uma demonstração.
+            uma demonstração.
         </para>
     </refsection>
     <refsection>
         <title>Exemplos</title>
-        <simplelist>
-            <member>
-                Exemplo #1: variações ao redor de um histograma de uma amostra gaussiana aleatória
-                <programlisting role="example"><![CDATA[
-d=rand(1,10000,'normal');  // a amostra gaussiana aleatória
-clf();histplot(20,d)
-clf();histplot(20,d,normalization=%f)
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=5)
-clf();histplot(20,d,leg='rand(1,10000,''normal'')',style=16, rect=[-3,0,3,0.5]);
+            <para>
+                <emphasis role="bold">Exemplo #1</emphasis> :
+                variações ao redor de um histograma de uma amostra gaussiana aleatória
+            </para>
+            <programlisting role="example"><![CDATA[
+d = rand(1,10000,'normal');  // a amostra gaussiana aleatória
+clf(); histplot(20, d);
+clf(); histplot(20, d, normalization=%f);
+clf(); histplot(20, d, leg='rand(1,10000,''normal'')', style=5);
+clf(); histplot(20, d, leg='rand(1,10000,''normal'')', style=16, rect=[-3,0,3,0.5]);
 ]]></programlisting>
-            </member>
-            <member>
-                Exemplo #2: histograma de uma amsostra binomial (B(6,0.5)) aleatória
+            <para/>
+            <para>
+                <emphasis role="bold">Exemplo #2</emphasis> :
+                histograma de uma amsostra binomial (B(6,0.5)) aleatória
+            </para>
                 <programlisting role="example"><![CDATA[
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
+
 clf()
 subplot(2,1,1)
-histplot(c, d, style=2)
+histplot(c, d, style=2);
 xtitle("histograma normalizado")
+
 subplot(2,1,2)
-histplot(c, d, normalization=%f, style=5)
-xtitle("histograma não normalizado")
+histplot(c, d, normalization=%f, style=5);
+xtitle("histograma não normalizado")
 ]]></programlisting>
-            </member>
-            <member>
-                Exemplo #3: histograma de uma amostra exponencial aleatória
+            <para/>
+            <para>
+                <emphasis role="bold">Exemplo #3</emphasis> :
+                histograma de uma amostra exponencial aleatória
+            </para>
                 <programlisting role="example"><![CDATA[
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
+
 clf()
-histplot(40, X, style=2)
+histplot(40, X, style=2);
 x = linspace(0,max(Xmax),100)';
 plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)
-legend(["histograma de amostra exponencial aleatória" "curva de densidade exata"]);
+legend(["histograma de amostra exponencial aleatória" "curva de densidade exata"]);
+]]></programlisting>
+            <para/>
+            <para>
+                <emphasis role="bold">Exemplo #4</emphasis>:
+                the frequency polygon chart and the histogram of a gaussian random sample
+            </para>
+            <programlisting role="example"><![CDATA[
+n = 10;
+data = rand(1,1000,"normal");
+
+clf(); histplot(n, data, style=12, polygon=%t);
+legend(["histograma normalizado" "frequency polygon chart"],"lower_caption");
 ]]></programlisting>
-            </member>
-        </simplelist>
     </refsection>
     <refsection>
-        <title>Ver Também</title>
+        <title>Ver Também</title>
         <simplelist type="inline">
             <member>
                 <link linkend="hist3d">hist3d</link>
@@ -168,4 +199,15 @@ legend(["histograma de amostra exponencial aleat
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revdescription>
+                    <literal>polygon</literal> option and <literal>cf</literal> output added.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 7e1d749..a2df9ac 100644 (file)
@@ -934,34 +934,35 @@ hist3d_fr_FR_1.png=9031d249fda1aeea0a14f05417e56bd7
 hist3d_ja_JP_1.png=9031d249fda1aeea0a14f05417e56bd7
 hist3d_pt_BR_1.png=9031d249fda1aeea0a14f05417e56bd7
 hist3d_ru_RU_1.png=9031d249fda1aeea0a14f05417e56bd7
-histc_1.png=c2a0daa3b13faeafe316bfb8d6403b6
-histc_en_US_2.png=54cc4c7f58c2d5df08c2a1e3f13266d7
-histc_en_US_3.png=61ac0dd9e6ae58f01c4af41e370e9f64
-histc_en_US_4.png=749ab576fd1cd753cc7359ab2beab13a
-histc_fr_FR_2.png=c5db0b0cd5057fecca00fa6b82615f71
-histc_fr_FR_3.png=81a370cf3cc05bbfe92ce42b47d01f22
-histc_fr_FR_4.png=f0eb71678214cc4d2037a0a29ce06ab4
-histc_ja_JP_2.png=54cc4c7f58c2d5df08c2a1e3f13266d7
-histc_ja_JP_3.png=61ac0dd9e6ae58f01c4af41e370e9f64
-histc_ja_JP_4.png=749ab576fd1cd753cc7359ab2beab13a
-histc_pt_BR_2.png=54cc4c7f58c2d5df08c2a1e3f13266d7
-histc_pt_BR_3.png=61ac0dd9e6ae58f01c4af41e370e9f64
-histc_pt_BR_4.png=749ab576fd1cd753cc7359ab2beab13a
-histc_ru_RU_2.png=54cc4c7f58c2d5df08c2a1e3f13266d7
-histc_ru_RU_3.png=61ac0dd9e6ae58f01c4af41e370e9f64
-histc_ru_RU_4.png=749ab576fd1cd753cc7359ab2beab13a
+histc_1.png=e3160e15b52c7a263abc6dffd75986a2
+histc_en_US_2.png=9070537a80a0375317b25d3e8dae7cbb
+histc_en_US_3.png=31002528265de6488daf495e8099e50
+histc_en_US_4.png=b5f6b23a1b1ffc07f7f757b99de417f3
+histc_fr_FR_2.png=b88f7da2f29e4e54dade1ab37f25673f
+histc_fr_FR_3.png=9f67b78a341f6cb6fbd2bfd01af6445e
+histc_fr_FR_4.png=d59a06a8473a3c642c457580794688a3
+histc_ja_JP_2.png=aa5b81880d39e95eed5d46c4fe4fa16d
+histc_ja_JP_3.png=31002528265de6488daf495e8099e50
+histc_ja_JP_4.png=dfee4e3b15874ce09f823a25821d9e43
+histc_pt_BR_2.png=9070537a80a0375317b25d3e8dae7cbb
+histc_pt_BR_3.png=31002528265de6488daf495e8099e50
+histc_pt_BR_4.png=b5f6b23a1b1ffc07f7f757b99de417f3
+histc_ru_RU_2.png=9070537a80a0375317b25d3e8dae7cbb
+histc_ru_RU_3.png=31002528265de6488daf495e8099e50
+histc_ru_RU_4.png=b5f6b23a1b1ffc07f7f757b99de417f3
 histplot_1.png=becfb3115ba4cd9eaee18c2535dc557a
 histplot_en_US_2.png=8117e3f08f726740eb7a4e19b7c80cf1
 histplot_en_US_3.png=cd3e60e8f0a028549da7547fbf4b7222
-histplot_en_US_4.png=ac27914effe5c72bfcd955f7a90d43d2
+histplot_en_US_4.png=32ceb6321053502807acf86e7718e1e6
 histplot_fr_FR_2.png=d7eff354adbf2b188f02d60ae6a83c8c
 histplot_fr_FR_3.png=77b4c00287c0149ee45394cb8d7c90f9
+histplot_fr_FR_4.png=9f0488890164fcd63430aa90ca92ecd8
 histplot_ja_JP_2.png=8117e3f08f726740eb7a4e19b7c80cf1
 histplot_ja_JP_3.png=cd3e60e8f0a028549da7547fbf4b7222
-histplot_ja_JP_4.png=ac27914effe5c72bfcd955f7a90d43d2
+histplot_ja_JP_4.png=32ceb6321053502807acf86e7718e1e6
 histplot_ru_RU_2.png=8117e3f08f726740eb7a4e19b7c80cf1
 histplot_ru_RU_3.png=cd3e60e8f0a028549da7547fbf4b7222
-histplot_ru_RU_4.png=ac27914effe5c72bfcd955f7a90d43d2
+histplot_ru_RU_4.png=32ceb6321053502807acf86e7718e1e6
 hotcolormap_1.png=93b81776ad0b15d88239eab74997022e
 householder_1.png=8a7bce8cfadfbf5d70436734b66ec20d
 hsv2rgb_1.png=7d20c259e94301d9763fbddb7bff4784
index 39a01c1..8bc8696 100644 (file)
Binary files a/scilab/modules/helptools/images/Graphics_15.png and b/scilab/modules/helptools/images/Graphics_15.png differ
index d79ec93..82ec6d8 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_en_US_1.png and b/scilab/modules/helptools/images/grand_en_US_1.png differ
index d285216..23cb942 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_en_US_2.png and b/scilab/modules/helptools/images/grand_en_US_2.png differ
index 014826c..64eaa2f 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_en_US_3.png and b/scilab/modules/helptools/images/grand_en_US_3.png differ
index bd5e056..d1503ac 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_en_US_4.png and b/scilab/modules/helptools/images/grand_en_US_4.png differ
index a93af02..767cbd2 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_fr_FR_1.png and b/scilab/modules/helptools/images/grand_fr_FR_1.png differ
index 64ade53..cede549 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_fr_FR_2.png and b/scilab/modules/helptools/images/grand_fr_FR_2.png differ
index 57d87dd..12700dc 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_fr_FR_3.png and b/scilab/modules/helptools/images/grand_fr_FR_3.png differ
index a47878c..075c098 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_fr_FR_4.png and b/scilab/modules/helptools/images/grand_fr_FR_4.png differ
index 5f0137b..23d68f3 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_pt_BR_1.png and b/scilab/modules/helptools/images/grand_pt_BR_1.png differ
index 12d515f..a8c867b 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_pt_BR_2.png and b/scilab/modules/helptools/images/grand_pt_BR_2.png differ
index fabf37c..68adefe 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_pt_BR_3.png and b/scilab/modules/helptools/images/grand_pt_BR_3.png differ
index 50c6eef..ea58ef6 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_pt_BR_4.png and b/scilab/modules/helptools/images/grand_pt_BR_4.png differ
index dc81639..ee3226a 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_ru_RU_1.png and b/scilab/modules/helptools/images/grand_ru_RU_1.png differ
index c53afd4..5a4f79c 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_ru_RU_2.png and b/scilab/modules/helptools/images/grand_ru_RU_2.png differ
index fd6ca93..77b87a6 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_ru_RU_3.png and b/scilab/modules/helptools/images/grand_ru_RU_3.png differ
index d9526de..4119811 100644 (file)
Binary files a/scilab/modules/helptools/images/grand_ru_RU_4.png and b/scilab/modules/helptools/images/grand_ru_RU_4.png differ
index 96266a4..d880c3c 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_en_US_2.png and b/scilab/modules/helptools/images/histc_en_US_2.png differ
index 29898df..b09a126 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_en_US_3.png and b/scilab/modules/helptools/images/histc_en_US_3.png differ
index d947024..01b432c 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_en_US_4.png and b/scilab/modules/helptools/images/histc_en_US_4.png differ
index bfa706c..2b5771c 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_fr_FR_2.png and b/scilab/modules/helptools/images/histc_fr_FR_2.png differ
index 0a4390b..6bf776b 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_fr_FR_3.png and b/scilab/modules/helptools/images/histc_fr_FR_3.png differ
index 58d83b5..bf9872e 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_fr_FR_4.png and b/scilab/modules/helptools/images/histc_fr_FR_4.png differ
index 225c22a..4419887 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ja_JP_2.png and b/scilab/modules/helptools/images/histc_ja_JP_2.png differ
index 19e4a6a..7870d17 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ja_JP_3.png and b/scilab/modules/helptools/images/histc_ja_JP_3.png differ
index 1081dc4..bf9872e 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ja_JP_4.png and b/scilab/modules/helptools/images/histc_ja_JP_4.png differ
index 8db794d..9ca21e9 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_pt_BR_2.png and b/scilab/modules/helptools/images/histc_pt_BR_2.png differ
index 3d87352..57acd14 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_pt_BR_3.png and b/scilab/modules/helptools/images/histc_pt_BR_3.png differ
index 4c717dc..ab1179f 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_pt_BR_4.png and b/scilab/modules/helptools/images/histc_pt_BR_4.png differ
index 8db794d..819db90 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ru_RU_2.png and b/scilab/modules/helptools/images/histc_ru_RU_2.png differ
index 3d87352..9512032 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ru_RU_3.png and b/scilab/modules/helptools/images/histc_ru_RU_3.png differ
index 4c717dc..8a81569 100644 (file)
Binary files a/scilab/modules/helptools/images/histc_ru_RU_4.png and b/scilab/modules/helptools/images/histc_ru_RU_4.png differ
index 1af45af..c665a57 100644 (file)
Binary files a/scilab/modules/helptools/images/histplot_1.png and b/scilab/modules/helptools/images/histplot_1.png differ
index f0af9d6..90a9192 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 f66b96b..6bed3e0 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 fcf5f56..caaf2cd 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 7e99746..2e8abe5 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 63f0b0a..f3746ee 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
diff --git a/scilab/modules/helptools/images/histplot_fr_FR_4.png b/scilab/modules/helptools/images/histplot_fr_FR_4.png
new file mode 100644 (file)
index 0000000..66ef0ce
Binary files /dev/null and b/scilab/modules/helptools/images/histplot_fr_FR_4.png differ
index 971687a..d15986c 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 c1ecac8..1120544 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 0263b67..5d4b837 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 bcd9e51..6de5ed0 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 fa53fc4..5e37e48 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 2a4bbab..00d732a 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
index 8d2dd3b..bf864af 100644 (file)
Binary files a/scilab/modules/helptools/images/xsetech_1.png and b/scilab/modules/helptools/images/xsetech_1.png differ
index 3075683..c931166 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * along with this program.
  *
  --><!-- This document was created with Syntext Serna Free. -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="histc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="histc">
     <refnamediv>
         <refname>histc</refname>
         <refpurpose>computes an histogram</refpurpose>
@@ -21,8 +24,9 @@
     <refsynopsisdiv>
         <title>Syntax</title>
         <synopsis>
-            [cf, ind] = histc(n, data [,normalization])
-            [cf, ind] = histc(x, data [,normalization])
+            h = histc(n, data)
+            h = histc(x, data)
+            h = histc(.., normalization)
         </synopsis>
     </refsynopsisdiv>
     <refsection role="parameters">
@@ -38,7 +42,8 @@
                 <term>x</term>
                 <listitem>
                     <para>
-                        increasing vector defining the classes (<literal>x</literal> may have at least 2 components)
+                        increasing vector defining the classes (<literal>x</literal> may have at
+                        least 2 components)
                     </para>
                 </listitem>
             </varlistentry>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>cf</term>
+                <term>h</term>
                 <listitem>
                     <para>
-                        vector representing the number of values of <varname>data</varname>
-                        falling in the classes defined by <varname>n</varname> or <varname>x</varname>
+                      <itemizedlist>
+                        <listitem>
+                            <para>
+                            If <varname>normalization</varname> is %T: Probability densities on the
+                            bins defined by <varname>n</varname> or <varname>x</varname>, such that
+                            the bins areas are proportionnal to their populations.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                            If <varname>normalization</varname> is %F: Numbers of elements in the bins.
+                            </para>
+                        </listitem>
+                      </itemizedlist>
                     </para>
                 </listitem>
             </varlistentry>
+          <!--
             <varlistentry>
                 <term>ind</term>
                 <listitem>
                     </para>
                 </listitem>
             </varlistentry>
+           -->
             <varlistentry>
                 <term>normalization</term>
                 <listitem>
                     <para>
-                        scalar boolean.
-                        <varname>normalization=%t (default)</varname>: <varname>cf</varname> represents the number of points in each class, relatively to the total number of points,
-                        <varname>normalization=%f</varname>: <varname>cf</varname> represents the total number of points in each class
+                      scalar boolean (default = %T), setting the type of output
+                      (see <varname>h</varname>).
                     </para>
                 </listitem>
             </varlistentry>
 // The gaussian random sample
 d = rand(1, 10000, 'normal');
 
-[cf, ind] = histc(20, d, normalization=%f)
+h = histc(20, d, normalization=%f);
+sum(h)   // = 10000
 // We use histplot to show a graphic representation
 clf(); histplot(20, d, normalization=%f);
 
-[cf, ind] = histc(20, d)
+// Normalized histogram (probability density)
+h = histc(20, d);
+dx = (max(d)-min(d))/20;  sum(h)*dx   // = 1
 clf(); histplot(20, d);
 ]]></programlisting>
                 <scilab:image>
                     d = rand(1, 10000, 'normal');
-                    [cf, ind] = histc(20, d)
+                    h = histc(20, d);
                     clf(); histplot(20, d);
                 </scilab:image>
             </member>
@@ -133,12 +154,14 @@ clf(); histplot(20, d);
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
 clf()
+
 subplot(2,1,1)
-[cf, ind] = histc(c, d)
+h = histc(c, d);
 histplot(c, d, style=2);
 xtitle(_("Normalized histogram"))
+
 subplot(2,1,2)
-[cf, ind] = histc(c, d, normalization=%f)
+h = histc(c, d, normalization=%f);
 histplot(c, d, normalization=%f, style=5);
 xtitle(_("Non normalized histogram"))
 ]]></programlisting>
@@ -147,11 +170,11 @@ xtitle(_("Non normalized histogram"))
                     c = linspace(-0.5,6.5,8);
                     clf()
                     subplot(2,1,1)
-                    [cf, ind] = histc(c, d)
+                    h = histc(c, d);
                     histplot(c, d, style=2);
                     xtitle(_("Normalized histogram"))
                     subplot(2,1,2)
-                    [cf, ind] = histc(c, d, normalization=%f)
+                    h = histc(c, d, normalization=%f)
                     histplot(c, d, normalization=%f, style=5);
                     xtitle(_("Non normalized histogram"))
                 </scilab:image>
@@ -162,7 +185,8 @@ xtitle(_("Non normalized histogram"))
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
-[cf, ind] = histc(40, X)
+h = histc(40, X);
+
 clf()
 histplot(40, X, style=2);
 x = linspace(0, max(Xmax), 100)';
@@ -173,7 +197,7 @@ legend([_("exponential random sample histogram") _("exact density curve")]);
                     lambda = 2;
                     X = grand(100000,1,"exp", 1/lambda);
                     Xmax = max(X);
-                    [cf, ind] = histc(40, X)
+                    h = histc(40, X);
                     clf()
                     histplot(40, X, style=2);
                     x = linspace(0, max(Xmax), 100)';
@@ -186,16 +210,17 @@ legend([_("exponential random sample histogram") _("exact density curve")]);
                 <programlisting role="example"><![CDATA[
 n = 10;
 data = rand(1, 1000, "normal");
-[cf, ind] = histc(n, data)
-clf(); histplot(n, data, style=12, polygon=%t);
-legend([_("normalized histogram") _("frequency polygon chart")]);
+h = histc(n, data);
+
+clf(), histplot(n, data, style=12, polygon=%t);
+legend([_("normalized histogram") _("frequency polygon chart")], "lower_caption");
 ]]></programlisting>
                 <scilab:image localized="true">
                     n = 10;
                     data = rand(1, 1000, "normal");
-                    [cf, ind] = histc(n, data)
+                    h = histc(n, data);
                     clf(); histplot(n, data, style=12, polygon=%t);
-                    legend([_("normalized histogram") _("frequency polygon chart")]);
+                    legend([_("normalized histogram") _("frequency polygon chart")],"lower_caption");
                 </scilab:image>
             </member>
         </simplelist>
index ade8774..1bee2a3 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * along with this program.
  *
  --><!-- This document was created with Syntext Serna Free. -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="histc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="fr" xml:id="histc">
     <refnamediv>
         <refname>histc</refname>
         <refpurpose>calcule un histogramme</refpurpose>
@@ -21,8 +24,9 @@
     <refsynopsisdiv>
         <title>Syntaxe</title>
         <synopsis>
-            [cf, ind] = histc(n, data [,normalization])
-            [cf, ind] = histc(x, data [,normalization])
+            h = histc(n, data)
+            h = histc(x, data)
+            h = histc(.., normalization)
         </synopsis>
     </refsynopsisdiv>
     <refsection role="parameters">
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>cf</term>
+                <term>h</term>
                 <listitem>
                     <para>
-                        vecteur représentant le nombre de valeurs de <varname>data</varname>
-                        tombant dans les classes définies par <varname>n</varname> ou <varname>x</varname>
+                      <itemizedlist>
+                        <listitem>
+                          Si <varname>normalization</varname> est %T: densités de probabilité sur
+                          les intervalles définis par <varname>n</varname> or <varname>x</varname>,
+                          telles que l'aire de chaque intervalle est proportionnelle à sa population.
+                        </listitem>
+                        <listitem>
+                          Si <varname>normalization</varname> est %F: nombres d'éléments peuplant
+                          les intervalles.
+                        </listitem>
+                      </itemizedlist>
                     </para>
                 </listitem>
             </varlistentry>
+          <!--
             <varlistentry>
                 <term>ind</term>
                 <listitem>
                     </para>
                 </listitem>
             </varlistentry>
+           -->
             <varlistentry>
                 <term>normalization</term>
                 <listitem>
                     <para>
-                        scalaire booléen.
-                        <varname>normalization=%f (par défaut)</varname>: <varname>cf</varname> représente le nombre total de points dans chaque classe,
-                        <varname>normalization=%t</varname>: <varname>cf</varname> représente le nombre de points dans chaque classe, relativement au nombre total de points
+                      booléen simple (%T par défaut), déterminant le type de résultat
+                      (voir <varname>h</varname>).
                     </para>
                 </listitem>
             </varlistentry>
             avec <emphasis>dx = (x(n+1)-x(1))/n</emphasis>.
         </para>
         <para>
-            Les classes sont définies par <literal>C1 = [x(1), x(2)]</literal> et <literal>Ci = ( x(i), x(i+1)]</literal> pour i &gt;= 2.
+            Les classes sont définies par <literal>C1 = [x(1), x(2)]</literal> et
+            <literal>Ci = ( x(i), x(i+1)]</literal> pour i &gt;= 2.
             Si l'on note <literal>Nmax</literal> le nombre total de <literal>data</literal> (Nmax = length(data))
             et <literal>Ni</literal> le nombre d'éléments de <literal>data</literal> tombant dans
             <literal>Ci</literal>, la valeur de l'histogramme pour <literal>x</literal> dans
             Quand la normalisation a lieu, l'histogramme vérifie:
         </para>
         <para>
-            <latex style="display"><![CDATA[ \int_{x(1)}^{x(n+1)}h(x)\,\mathrm{d}x=1 ]]></latex>
+            <latex style="display"><![CDATA[ \int_{x(1)}^{x(n+1)}h(x)\,\mathrm{d}x = 1 ]]></latex>
         </para>
         <para>
             quand <emphasis>x(1)&lt;=min(data)</emphasis> et <emphasis>max(data) &lt;= x(n+1)</emphasis>
 // L'échantillon aléatoire gaussien
 d = rand(1, 10000, 'normal');
 
-[cf, ind] = histc(20, d, normalization=%f)
+h = histc(20, d, normalization=%f);
+sum(h)   // = 10000
 // On utilise histplot pour avoir une représentation graphique
 clf(); histplot(20, d, normalization=%f);
 
-[cf, ind] = histc(20, d)
+// Histogramme d'aire normalisée (densité de probabilité)
+h = histc(20, d);
+dx = (max(d)-min(d))/20;  sum(h)*dx   // = 1
 clf(); histplot(20, d);
 ]]></programlisting>
                 <scilab:image>
                     d = rand(1, 10000, 'normal');
-                    [cf, ind] = histc(20, d)
+                    h = histc(20, d);
                     clf(); histplot(20, d);
                 </scilab:image>
             </member>
@@ -133,12 +151,14 @@ clf(); histplot(20, d);
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
 clf()
+
 subplot(2,1,1)
-[cf, ind] = histc(c, d)
+h = histc(c, d);
 histplot(c, d, style=2);
 xtitle("Histogramme d''aire normalisée")
+
 subplot(2,1,2)
-[cf, ind] = histc(c, d, normalization=%f)
+h = histc(c, d, normalization=%f);
 histplot(c, d, normalization=%f, style=5);
 xtitle("Histogramme brut")
 ]]></programlisting>
@@ -147,11 +167,11 @@ xtitle("Histogramme brut")
                     c = linspace(-0.5,6.5,8);
                     clf()
                     subplot(2,1,1)
-                    [cf, ind] = histc(c, d)
+                    h = histc(c, d);
                     histplot(c, d, style=2);
                     xtitle("Histogramme d''aire normalisée")
                     subplot(2,1,2)
-                    [cf, ind] = histc(c, d, normalization=%f)
+                    h = histc(c, d, normalization=%f)
                     histplot(c, d, normalization=%f, style=5);
                     xtitle("Histogramme brut")
                 </scilab:image>
@@ -162,7 +182,8 @@ xtitle("Histogramme brut")
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
-[cf, ind] = histc(40, X)
+h = histc(40, X);
+
 clf()
 histplot(40, X, style=2);
 x = linspace(0, max(Xmax), 100)';
@@ -173,7 +194,7 @@ legend(["Histogramme d''un échantillon de distribution exponentielle" "Fonction
                     lambda = 2;
                     X = grand(100000,1,"exp", 1/lambda);
                     Xmax = max(X);
-                    [cf, ind] = histc(40, X)
+                    h = histc(40, X);
                     clf()
                     histplot(40, X, style=2);
                     x = linspace(0, max(Xmax), 100)';
@@ -186,16 +207,17 @@ legend(["Histogramme d''un échantillon de distribution exponentielle" "Fonction
                 <programlisting role="example"><![CDATA[
 n = 10;
 data = rand(1, 1000, "normal");
-[cf, ind] = histc(n, data)
+h = histc(n, data);
+
 clf(); histplot(n, data, style=12, polygon=%t);
-legend(["Histogramme d''aire normalisée" "Polygone des fréquences"]);
+legend(["Histogramme d''aire normalisée" "Polygone des fréquences"], "lower_caption");
 ]]></programlisting>
                 <scilab:image localized="true">
                     n = 10;
                     data = rand(1, 1000, "normal");
-                    [cf, ind] = histc(n, data)
+                    h = histc(n, data);
                     clf(); histplot(n, data, style=12, polygon=%t);
-                    legend(["Histogramme d''aire normalisée" "Polygone des fréquences"]);
+                    legend(["Histogramme d''aire normalisée" "Polygone des fréquences"], "lower_caption");
                 </scilab:image>
             </member>
         </simplelist>
index 89e9c31..516b416 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * 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.
  * along with this program.
  *
  --><!-- This document was created with Syntext Serna Free. -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="histc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="ja" xml:id="histc">
     <refnamediv>
         <refname>histc</refname>
         <refpurpose>ヒストグラムを計算</refpurpose>
@@ -21,8 +24,9 @@
     <refsynopsisdiv>
         <title>呼び出し手順</title>
         <synopsis>
-            [cf, ind] = histc(n, data [,normalization])
-            [cf, ind] = histc(x, data [,normalization])
+            h = histc(n, data)
+            h = histc(x, data)
+            h = histc(.., normalization)
         </synopsis>
     </refsynopsisdiv>
     <refsection role="parameters">
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>cf</term>
+                <term>h</term>
                 <listitem>
                     <para>
-                        <varname>n</varname> または <varname>x</varname>
-                        により定義されるクラスに含まれる
-                        <varname>data</varname>の値の数を示すベクトル
+                      <itemizedlist>
+                        <listitem>
+                            <para>
+                            If <varname>normalization</varname> is %T: Probability densities on the
+                            bins defined by <varname>n</varname> or <varname>x</varname>, such that
+                            the bins areas are proportionnal to their populations.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                            If <varname>normalization</varname> is %F: Numbers of elements in the bins.
+                            </para>
+                        </listitem>
+                      </itemizedlist>
                     </para>
                 </listitem>
             </varlistentry>
+            <!--
             <varlistentry>
                 <term>ind</term>
                 <listitem>
                     </para>
                 </listitem>
             </varlistentry>
+            -->
             <varlistentry>
                 <term>normalization</term>
                 <listitem>
                     <para>
-                        スカラー論理値.
-                        <varname>normalization=%f (デフォルト)</varname>:
-                        <varname>cf</varname>は,各クラスにおける点の総数を表します.
-                        <varname>normalization=%t</varname>:
-                        <varname>cf</varname>は,各クラスにおける点の数を点の総数に関して相対的に表します.
+                      スカラー論理値 (デフォルト %T), setting the type of output
+                      (see <varname>h</varname>).
                     </para>
                 </listitem>
             </varlistentry>
                 <programlisting role="example"><![CDATA[
 // ガウス乱数標本
 d = rand(1, 10000, 'normal');
-[cf, ind] = histc(20, d, normalization=%f)
+h = histc(20, d, normalization=%f);
+sum(h)   // = 10000
 // グラフィック表現を示すためにhistplotを使用
 clf(); histplot(20, d, normalization=%f);
-[cf, ind] = histc(20, d)
+
+// Normalized histogram (probability density)
+h = histc(20, d);
+dx = (max(d)-min(d))/20;  sum(h)*dx   // = 1
 clf(); histplot(20, d);
 ]]></programlisting>
                 <scilab:image>
                     d = rand(1, 10000, 'normal');
-                    [cf, ind] = histc(20, d)
+                    h = histc(20, d);
                     clf(); histplot(20, d);
                 </scilab:image>
             </member>
@@ -139,12 +157,14 @@ clf(); histplot(20, d);
 d = grand(1000,1,"bin", 6, 0.5);
 c = linspace(-0.5,6.5,8);
 clf()
+
 subplot(2,1,1)
-[cf, ind] = histc(c, d)
+h = histc(c, d);
 histplot(c, d, style=2);
 xtitle(_("Normalized histogram"))
+
 subplot(2,1,2)
-[cf, ind] = histc(c, d, normalization=%f)
+h = histc(c, d, normalization=%f);
 histplot(c, d, normalization=%f, style=5);
 xtitle(_("Non normalized histogram"))
 ]]></programlisting>
@@ -153,11 +173,11 @@ xtitle(_("Non normalized histogram"))
                     c = linspace(-0.5,6.5,8);
                     clf()
                     subplot(2,1,1)
-                    [cf, ind] = histc(c, d)
+                    h = histc(c, d);
                     histplot(c, d, style=2);
                     xtitle(_("Normalized histogram"))
                     subplot(2,1,2)
-                    [cf, ind] = histc(c, d, normalization=%f)
+                    h = histc(c, d, normalization=%f);
                     histplot(c, d, normalization=%f, style=5);
                     xtitle(_("Non normalized histogram"))
                 </scilab:image>
@@ -168,7 +188,8 @@ xtitle(_("Non normalized histogram"))
 lambda = 2;
 X = grand(100000,1,"exp", 1/lambda);
 Xmax = max(X);
-[cf, ind] = histc(40, X)
+h = histc(40, X);
+
 clf()
 histplot(40, X, style=2);
 x = linspace(0, max(Xmax), 100)';
@@ -179,7 +200,7 @@ legend([_("exponential random sample histogram") _("exact density curve")]);
                     lambda = 2;
                     X = grand(100000,1,"exp", 1/lambda);
                     Xmax = max(X);
-                    [cf, ind] = histc(40, X)
+                    h = histc(40, X);
                     clf()
                     histplot(40, X, style=2);
                     x = linspace(0, max(Xmax), 100)';
@@ -192,16 +213,17 @@ legend([_("exponential random sample histogram") _("exact density curve")]);
                 <programlisting role="example"><![CDATA[
 n = 10;
 data = rand(1, 1000, "normal");
-[cf, ind] = histc(n, data)
+h = histc(n, data);
+
 clf(); histplot(n, data, style=12, polygon=%t);
-legend([_("normalized histogram") _("frequency polygon chart")]);
+legend([_("normalized histogram") _("frequency polygon chart")], "lower_caption");
 ]]></programlisting>
                 <scilab:image localized="true">
                     n = 10;
                     data = rand(1, 1000, "normal");
-                    [cf, ind] = histc(n, data)
+                    h = histc(n, data);
                     clf(); histplot(n, data, style=12, polygon=%t);
-                    legend([_("normalized histogram") _("frequency polygon chart")]);
+                    legend([_("normalized histogram") _("frequency polygon chart")], "lower_caption");
                 </scilab:image>
             </member>
         </simplelist>
index 55fcbd9..8781a7c 100644 (file)
@@ -1,7 +1,7 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2013 - A. Khorshidi
-//
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
+// 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.
@@ -69,11 +69,9 @@ function [cf, ind] = histc(n, data, normalization)
     [ind, cf, info] = dsearch(data, cb); // cf: class frequency, ind: class number of each count
 
     // Normalization
-    if normalization == %t then
-        nd = size(data, "*"); // Number of data values
-        //cw = cb(2:$)-cb(1:$-1); // Bin width
-        //cf = cf./(nd*cw); // Normalization in bin heights
-        cf = cf./nd; // Heights normalization
+    nd = size(data, "*"); // Number of data values
+    if normalization
+        cw = cb(2:$)-cb(1:$-1); // Bins widths
+        cf = cf./(nd*cw)        // ==> Normalized density == Density probability function
     end
-
 endfunction