Split the colorbar examples in 3 91/8591/2
Sylvestre Ledru [Tue, 7 Aug 2012 09:13:03 +0000 (11:13 +0200)]
Change-Id: I51b87228f2c950b254ec96c1059c9ae8a621ec46

scilab/modules/graphics/help/en_US/color_management/colorbar.xml

index fc188f7..71b0aed 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <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" version="5.0-subset Scilab" xml:lang="en" xml:id="colorbar">
-  <refnamediv>
-    <refname>colorbar</refname>
-    <refpurpose>draw a colorbar</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>colorbar(umin, umax [, colminmax, fmt])</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>umin</term>
-        <listitem>
-          <para>real scalar, the minimum value associated with the plot</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>umax</term>
-        <listitem>
-          <para>real scalar, the maximum value associated with the plot</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>colminmax</term>
-        <listitem>
-          <para>(optional) a vector with 2 integer components</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>fmt</term>
-        <listitem>
-          <para>(optional) a string to set up the display format for
-            colorbar graduations
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      Draw a colorbar for a plot3d, fec, Sgrayplot, etc... The function may be called
-      <emphasis role="bold">BEFORE</emphasis> the plot3d, fec, Sgrayplot,... because its sets and changes the
-      frame for the plot. This way the colorbar is not part of the associated plot and 
-      so is not modified by a zoom or a rotation.
-    </para>
-    <para>
-      The optional argument <literal>colminmax</literal> may be used to precise the first color
-      (associated with umin) and the last color (associated with umax) of the current 
-      colormap. By default <literal>colminmax=[1 nb_colors]</literal> where nb_colors is the 
-      number of colors of the current colormap.
-    </para>
-    <para>
-      The optional argument <literal>fmt</literal> is a string containing a
-      C-format, like <literal>"%.2f"</literal>, <literal>"%e"</literal>, etc... 
-    </para>
-    <para>
-      For the 2 optional arguments you can use the syntax
-      <literal>keyword=value</literal> (see the last example).
-    </para>
-  </refsection>
-  <refsection>
-    <title>Sample</title>
-    <scilab:image> 
-      // example 1
-      x = linspace(0,1,81);
-      z = cos(2*%pi*x)'*sin(2*%pi*x);
-      zm = min(z); zM = max(z);
-      clf()
-      xset("colormap",jetcolormap(64))
-      colorbar(zm,zM)
-      Sgrayplot(x,x,z)
-      xtitle("The function cos(2 pi x)sin(2 pi y)")
-      // example 2 
-      x = linspace(0,1,81);
-      z = cos(2*%pi*x)'*sin(2*%pi*x);
-      zm = min(z); zM = max(z);
-      zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
-      zzm = min(zz); zzM = max(zz);
-      clf();
-      xset("colormap",jetcolormap(64))
-      drawlater() ;
-      subplot(2,2,1)
-      colorbar(zm,zM)
-      Sgrayplot(x,x,z, strf="031", rect=[0 0 1 1])
-      xtitle("a Sgrayplot with a colorbar")
-      subplot(2,2,2)
-      colorbar(zm,zM)
-      plot3d1(x,x,z)
-      xtitle("a plot3d1 with a colorbar")
-      subplot(2,2,3)
-      colorbar(zzm,zzM)
-      plot3d1(x,x,zz)
-      xtitle("a plot3d1 with a colorbar")
-      subplot(2,2,4)
-      colorbar(zzm,zzM)
-      Sgrayplot(x,x,zz, strf="031", rect=[0 0 1 1])
-      xtitle("a Sgrayplot with a colorbar")
-      drawnow() ;
-      // example 3
-      x = linspace(0,1,81);
-      zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
-      zzm = min(zz); zzM = max(zz);
-      [xf,yf,zf]=genfac3d(x,x,zz);
-      nb_col = 64;
-      clf()
-      xset("colormap",hotcolormap(nb_col))
-      drawlater() ;
-      colorbar(zzm,zzM,[1, nb_col],fmt="%.1f")
-      nbcol = xget("lastpattern")
-      zcol = dsearch(zf, linspace(zzm, zzM, nb_col+1));
-      plot3d(xf, yf, list(zf, zcol), flag = [-2 6 4])
-      xtitle("a plot3d with shaded interpolated colors")
-      drawnow() ;
-      show_window()
-    </scilab:image>
-  </refsection>
-  <refsection>
-    <title>Examples</title>
-    <programlisting role="example"><![CDATA[ 
+    <refnamediv>
+        <refname>colorbar</refname>
+        <refpurpose>draw a colorbar</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>colorbar(umin, umax [, colminmax, fmt])</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>umin</term>
+                <listitem>
+                    <para>real scalar, the minimum value associated with the plot</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>umax</term>
+                <listitem>
+                    <para>real scalar, the maximum value associated with the plot</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>colminmax</term>
+                <listitem>
+                    <para>(optional) a vector with 2 integer components</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>fmt</term>
+                <listitem>
+                    <para>(optional) a string to set up the display format for
+                        colorbar graduations
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Draw a colorbar for a plot3d, fec, Sgrayplot, etc... The function may be called
+            <emphasis role="bold">BEFORE</emphasis> the plot3d, fec, Sgrayplot,... because its sets and changes the
+            frame for the plot. This way the colorbar is not part of the associated plot and 
+            so is not modified by a zoom or a rotation.
+        </para>
+        <para>
+            The optional argument <literal>colminmax</literal> may be used to precise the first color
+            (associated with umin) and the last color (associated with umax) of the current 
+            colormap. By default <literal>colminmax=[1 nb_colors]</literal> where nb_colors is the 
+            number of colors of the current colormap.
+        </para>
+        <para>
+            The optional argument <literal>fmt</literal> is a string containing a
+            C-format, like <literal>"%.2f"</literal>, <literal>"%e"</literal>, etc... 
+        </para>
+        <para>
+            For the 2 optional arguments you can use the syntax
+            <literal>keyword=value</literal> (see the last example).
+        </para>
+    </refsection>
+    <refsection>
+        <title>Sample</title>
+        <scilab:image localized="true"> 
+            // example 1
+            x = linspace(0,1,81);
+            z = cos(2*%pi*x)'*sin(2*%pi*x);
+            zm = min(z); zM = max(z);
+            clf()
+            xset("colormap",jetcolormap(64))
+            colorbar(zm,zM)
+            Sgrayplot(x,x,z)
+            xtitle("The function cos(2 pi x)sin(2 pi y)")
+        </scilab:image>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
 // example 1
 x = linspace(0,1,81);
 z = cos(2*%pi*x)'*sin(2*%pi*x);
@@ -130,7 +88,8 @@ xset("colormap",jetcolormap(64))
 colorbar(zm,zM)
 Sgrayplot(x,x,z)
 xtitle("The function cos(2 pi x)sin(2 pi y)")
-
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[ 
 // example 2 
 x = linspace(0,1,81);
 z = cos(2*%pi*x)'*sin(2*%pi*x);
@@ -158,7 +117,37 @@ subplot(2,2,4)
    Sgrayplot(x,x,zz, strf="031", rect=[0 0 1 1])
    xtitle("a Sgrayplot with a colorbar")
 drawnow() ;
-
+ ]]></programlisting>
+        <scilab:image localized="true"> 
+            x = linspace(0,1,81);
+            z = cos(2*%pi*x)'*sin(2*%pi*x);
+            zm = min(z); zM = max(z);
+            zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
+            zzm = min(zz); zzM = max(zz);
+            clf();
+            xset("colormap",jetcolormap(64))
+            drawlater();
+            subplot(2,2,1)
+            colorbar(zm,zM)
+            Sgrayplot(x,x,z, strf="031", rect=[0 0 1 1])
+            xtitle("a Sgrayplot with a colorbar")
+            subplot(2,2,2)
+            colorbar(zm,zM)
+            plot3d1(x,x,z)
+            xtitle("a plot3d1 with a colorbar")
+            subplot(2,2,3)
+            colorbar(zzm,zzM)
+            plot3d1(x,x,zz)
+            xtitle("a plot3d1 with a colorbar")
+            subplot(2,2,4)
+            colorbar(zzm,zzM)
+            Sgrayplot(x,x,zz, strf="031", rect=[0 0 1 1])
+            xtitle("a Sgrayplot with a colorbar")
+            drawnow() ;
+            
+        </scilab:image>
+        
+        <programlisting role="example"><![CDATA[ 
 // example 3
 x = linspace(0,1,81);
 zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
@@ -176,13 +165,26 @@ xtitle("a plot3d with shaded interpolated colors")
 drawnow() ;
 show_window()
  ]]></programlisting>
-  </refsection>
-  <refsection role="see also">
-    <title>See Also</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="colormap">colormap</link>
-      </member>
-    </simplelist>
-  </refsection>
+        <scilab:image localized="true">
+            x = linspace(0,1,81);
+            zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
+            zzm = min(zz); zzM = max(zz);
+            [xf,yf,zf]=genfac3d(x,x,zz);
+            nb_col = 64;
+            xset("colormap",hotcolormap(nb_col))
+            colorbar(zzm,zzM,[1, nb_col],fmt="%.1f")
+            nbcol = xget("lastpattern")
+            zcol = dsearch(zf, linspace(zzm, zzM, nb_col+1));
+            plot3d(xf, yf, list(zf, zcol), flag = [-2 6 4])
+            xtitle("a plot3d with shaded interpolated colors")
+        </scilab:image>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="colormap">colormap</link>
+            </member>
+        </simplelist>
+    </refsection>
 </refentry>