Bug 10122 fixed: Function replot cannot be used in 3D 93/13793/4
Samuel Gougeon [Wed, 19 Feb 2014 13:49:31 +0000 (14:49 +0100)]
Change-Id: Ia646f47aa164d52c0382d52807e778152d293663

scilab/CHANGES_5.5.X
scilab/modules/graphics/help/en_US/axes_operations/replot.xml
scilab/modules/graphics/help/fr_FR/axes_operations/replot.xml
scilab/modules/graphics/help/ja_JP/axes_operations/replot.xml
scilab/modules/graphics/help/pt_BR/axes_operations/replot.xml
scilab/modules/graphics/macros/replot.sci

index 5b2850f..97f7960 100644 (file)
@@ -216,6 +216,8 @@ Scilab Bug Fixes
 
 * Bug #10083 fixed - plot3d could not be used with only one input argument.
 
+* Bug #10122 fixed - Function replot could not be used in 3-D.
+
 * Bug #10175 fixed - Clearer example added for sp2adj to adj2sp conversion (and backwards conversion).
 
 * Bug #10214 fixed - Update help page of evstr function to mention that input argument must not be composed of
index a02cfac..afe0805 100644 (file)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) ENPC - Jean-Philippe Chancelier
+ * Copyright (C) 2013 - Samuel GOUGEON
  * 
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
  *
  -->
+
 <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="replot">
+    
     <refnamediv>
+        
         <refname>replot</refname>
-        <refpurpose>redraw the current graphics window with new
-            boundaries
+        
+        <refpurpose>redraw with new boundaries the current or a given set of axes
+            
         </refpurpose>
+        
     </refnamediv>
+    
     <refsynopsisdiv>
+        
         <title>Calling Sequence</title>
-        <synopsis>replot(rect,[handle])</synopsis>
+        
+        <synopsis>replot(area)</synopsis>
+        
+        <synopsis>replot(area, axesHandles)</synopsis>
+        
     </refsynopsisdiv>
+    
     <refsection>
+        
         <title>Arguments</title>
+        
         <variablelist>
+            
             <varlistentry>
-                <term>rect</term>
+                
+                <term>area</term>
+                
                 <listitem>
-                    <para>row vector of size 4.</para>
+                    
+                    <para>row vector [xmin ymin xmax ymax] or [xmin ymin zmin xmax ymax zmax]: new bounds of the area to be replotted. 
+                        
+                        <note>
+                            Use <literal>%nan</literal> to keep a bound as is.
+                        </note>
+                        
+                    </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
             <varlistentry>
-                <term>handle</term>
+                
+                <term>axeHandle</term>
+                
                 <listitem>
-                    <para>optional argument. Graphics handle(s) of type Axes to select
-                        one or several given Axes.
+                    
+                    <para>Vector of graphics handles of type Axes: Axes to crop. By default, the current Axes of the current figure is considered.
+                        
                     </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
         </variablelist>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Description</title>
+        
         <para>
-            <literal>replot</literal> is used to redraw the content of the current
-            graphics window with new boundaries defined by
-            <literal>rect=[xmin,ymin,xmax,ymax]</literal>. Under old graphics syntax, it
-            works only with the driver <literal>"Rec"</literal>.
+            
+            <literal>replot</literal> is used to redraw the content of the current graphics axes with new boundaries defined by
+            
+            <literal>area = [xmin,ymin, xmax,ymax]</literal> or <literal>area = [xmin,ymin,zmin, xmax,ymax,zmax]</literal>. 
+            
         </para>
+        
         <para>This transformation can be applied to specific
-            axes given by Axes graphics handles via the handle argument. If handle is
+            
+            axes given by Axes graphics handles via the <varname>axesHandles</varname> argument. If <varname>axesHandles</varname> is
+            
             not specified, the new boundaries are applied to the current axes of the
+            
             current figure. The transformation changes the <literal>data_bounds</literal>
-            value of those axes. Note that the axes property <literal>tight_limits</literal>
-            must also be set to "on" to strictly select those bounds (see
-            <link linkend="axes_properties">axes_properties</link>).<literal> </literal>
+            
+            value of those axes.
+            
         </para>
+        
+        <note>
+            The axes property <literal>tight_limits</literal>
+            
+            must be set to "on" to strictly select specified bounds (see
+            
+            <link linkend="axes_properties">axes_properties</link>)
+            
+        </note>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Examples</title>
+        
         <programlisting role="example"><![CDATA[
       x=[0:0.1:2*%pi]';
       plot2d(x,sin(x))
       replot([-1,-1,10,2])
       ]]></programlisting>
+        
         <scilab:image>
+            
             x=[0:0.1:2*%pi]';
+            
             plot2d(x,sin(x))
+            
             replot([-1,-1,10,2])
+            
         </scilab:image>
         
+        
+        
         <programlisting role="example"><![CDATA[
       xdel(winsid());
       plot() // plot demo
       replot([-1,-1,10,2],f.children(1)) // specify axes handle's value
       replot([-3,-2,8,4],f.children(2))
       ]]></programlisting>
+        
         <scilab:image>
+            
             xdel(winsid());
+            
             plot()
+            
             f2=gcf();
+            
             replot([-1,-1,10,2],f2.children(1))
+            
             replot([-3,-2,8,4],f2.children(2))
+            
         </scilab:image>
         
+        <programlisting role="example"><![CDATA[
+// Leaving some bounds as is with %nan:
+x = linspace(0,360,200).';
+clf
+plot2d(x,[sind(x) tand(x)])
+ax = gca();
+ax.data_bounds                         // initial bounds
+replot([%nan,-10,%nan,10])     // only Ymin and Ymax are changed
+ax.data_bounds                         // updated bounds
+
+// Resizing Z bounds as well as X and Y ones in 3D view:
+clf
+x = linspace(-4,4,100);
+X = meshgrid(x);
+R = (X-0.5).^2 + (X.'+0.7).^2;
+Z = sinc(R);
+surf(x-0.5,x+0.7,Z)
+f = gcf();
+f.color_map = autumncolormap(100);
+ax = gca();
+ax.data_bounds
+sleep(3000)
+replot([-5 0 -0.4 0 5 0.5])
+ax.data_bounds
+
+// Resizing several chosen axes together:
+clf
+x = linspace(-%pi,%pi,400);
+subplot(2,2,1)
+plot2d(x,sin(1 ./sqrt(abs(x))))
+ax1 = gca();
+subplot(2,2,2)
+plot2d(x,sinh(sqrt(abs(x))))
+subplot(2,1,2)
+plot2d(x,cos(1 ./sqrt(abs(x))))
+ax2 = gca();
+sleep(4000)
+f = gcf();
+replot([-1 %nan 1.5 %nan], [ax1 ax2])
+      ]]></programlisting>
+        
+        
+        
     </refsection>
+    
     <refsection role="see also">
+        
         <title>See Also</title>
+        
         <simplelist type="inline">
+            
             <member>
-                <link linkend="clf">clf</link>
+                
+                <link linkend="zoom_rect">zoom_rect</link>
+                
             </member>
+            
+            <member>
+                
+                <link linkend="rubberbox">rubberbox</link>
+                
+            </member>
+            
+            <member>
+                
+                <link linkend="axes_properties">axes_properties</link>
+                
+            </member>
+            
         </simplelist>
+        
+    </refsection>
+    
+    <refsection>
+        
+        <title>History</title>
+        
+        <revhistory>
+            
+            <revision>
+                
+                <revnumber>5.5.0</revnumber>
+                
+                <revdescription>
+                    
+                    <itemizedlist>
+                        
+                        <listitem>Extension to 3D
+                            
+                        </listitem>
+                        
+                        <listitem>axesHandles vectorized
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            <literal>%nan</literal> can be used to keep a bound as is.
+                            
+                        </listitem>
+                        
+                    </itemizedlist>
+                    
+                </revdescription>
+                
+            </revision>
+            
+        </revhistory>
+        
     </refsection>
+    
 </refentry>
index 861ccc6..88148f9 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) ENPC - Jean-Philippe Chancelier
+ * Copyright (C) 2012 - Scilab Enterprises
+ * Copyright (C) 2013 - Samuel GOUGEON
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
 <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="replot">
+    
     <refnamediv>
+        
         <refname>replot</refname>
-        <refpurpose>redessine la fenêtre graphique courante en
-            changeant les bornes
+        
+        <refpurpose>recadre la zone affichée d'un ou plusieurs repères graphiques
+            
         </refpurpose>
+        
     </refnamediv>
+    
     <refsynopsisdiv>
+        
         <title>Séquence d'appel</title>
-        <synopsis>replot(rect)</synopsis>
+        
+        <synopsis>replot(area)</synopsis>
+        
+        <synopsis>replot(area, axesHandles)</synopsis>
+        
     </refsynopsisdiv>
+    
     <refsection>
+        
         <title>Paramètres</title>
+        
         <variablelist>
+            
             <varlistentry>
-                <term>rect</term>
+                
+                <term>area</term>
+                
                 <listitem>
-                    <para>vecteur ligne de taille 4.</para>
+                    
+                    <para>vecteur [xmin ymin xmax ymax] ou [xmin ymin zmin xmax ymax zmax]: nouvelles bornes de la zone à réafficher. 
+                        
+                        Utiliser <literal>%nan</literal> pour conserver une borne telle quelle.
+                    </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
             <varlistentry>
-                <term>handle</term>
+                
+                <term>axesHandles</term>
+                
                 <listitem>
-                    <para>argument optionnel. Handle(s) graphiques de type Axes
-                        définissant le(s) axe(s) auxquels les nouvelles bornes s'appliquent.
+                    
+                    <para>Vecteur d'identifiants graphiques de type Axes: repères graphiques à retailler. Par défaut, le repère graphique actif de la fenêtre graphique active est considéré.
+                        
                     </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
         </variablelist>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Description</title>
+        
         <para>
-            <literal>replot</literal> est utilisée pour redessiner la fenêtre graphique
-            courante en changeant les bornes, données sous la forme
-            <literal>rect=[xmin,ymin,xmax,ymax]</literal>. En ancien mode graphique,
-            fonctionne uniquement avec le pilote <literal>"Rec"</literal>.
+            
+            <literal>replot</literal> est utilisée pour recadrer les repères graphiques spécifiés par <literal>axesHandles</literal> 
+            
+            (ou par défaut le repère graphique actif de la fenêtre graphique active) en changeant leurs bornes communes spécifiées sous la forme
+            
+            <literal>rect = [xmin,ymin, xmax,ymax]</literal> ou <literal>rect = [xmin,ymin,zmin, xmax,ymax,zmax]</literal>.
+            
         </para>
-        <para>En mode graphique, cette transformation s'applique aux axes
-            spécifiés par <literal>handle</literal> Si <literal>handle</literal> n'est pas
-            renseigné, la transformation s'applique à  l'axe courant de la figure
-            courante. La transformation change les valeurs <literal>data_bounds</literal>
-            des axes. A noter que la propriété <literal>tight_limits</literal> de l'axe doit
-            être mise à  <literal>"on"</literal> pour selectionner strictement ces bornes
-            (voir <link linkend="axes_properties">axes_properties</link>).<literal/>
+        
+        <para>
+            <varname>replot</varname> modifie les valeurs <literal>data_bounds</literal> des repères. 
+            
+            <note>
+                La propriété <literal>tight_limits</literal> des repères doit
+                
+                être mise à  <literal>"on"</literal> pour sélectionner strictement ces bornes
+                
+                (voir <link linkend="axes_properties">axes_properties</link>).
+                
+            </note>
+            
         </para>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Exemples</title>
+        
         <programlisting role="example"><![CDATA[ 
       // Premier exemple
       x=[0:0.1:2*%pi]';
       plot2d(x,sin(x))
       replot([-1,-1,10,2])
  ]]></programlisting>
+        
         <scilab:image>
+            
             x=[0:0.1:2*%pi]';
+            
             plot2d(x,sin(x))
+            
             replot([-1,-1,10,2])
+            
         </scilab:image>
         
+        
+        
         <programlisting role="example"><![CDATA[ 
 // second exemple
 xdel(winsid());
@@ -68,21 +136,137 @@ f=gcf();
 replot([-1,-1,10,2],f.children(1)) // specify axes handle's value
 replot([-3,-2,8,4],f.children(2)) 
  ]]></programlisting>
+        
         <scilab:image>
+            
             xdel(winsid());
+            
             plot()
+            
             f2=gcf();
+            
             replot([-1,-1,10,2],f2.children(1))
+            
             replot([-3,-2,8,4],f2.children(2))
+            
         </scilab:image>
         
+        <programlisting role="example"><![CDATA[
+// Les bornes signalées par la valeur %nan ne sont pas modifiées :
+x = linspace(0,360,200).';
+clf
+plot2d(x,[sind(x) tand(x)])
+ax = gca();
+ax.data_bounds                         // bornes initiales
+replot([%nan,-10,%nan,10])     // Seules Ymin and Ymax sont modifiées
+ax.data_bounds                         // nouvelles bornes
+
+// En 3D, les bornes en Z peuvent également être modifiées :
+clf
+x = linspace(-4,4,100);
+X = meshgrid(x);
+R = (X-0.5).^2 + (X.'+0.7).^2;
+Z = sinc(R);
+surf(x-0.5,x+0.7,Z)
+f = gcf();
+f.color_map = autumncolormap(100);
+ax = gca();
+ax.data_bounds
+sleep(3000)
+replot([-5 0 -0.4 0 5 0.5])
+ax.data_bounds
+
+// Plusieurs repères graphiques peuvent être simultanément recadrés :
+clf
+x = linspace(-%pi,%pi,400);
+subplot(2,2,1)
+plot2d(x,sin(1 ./sqrt(abs(x))))
+ax1 = gca();
+subplot(2,2,2)
+plot2d(x,sinh(sqrt(abs(x))))
+subplot(2,1,2)
+plot2d(x,cos(1 ./sqrt(abs(x))))
+ax2 = gca();
+sleep(4000)
+f = gcf();
+replot([-1 %nan 1.5 %nan], [ax1 ax2])
+      ]]></programlisting>
+        
+        
+        
     </refsection>
+    
     <refsection role="see also">
+        
         <title>Voir aussi</title>
+        
         <simplelist type="inline">
+            
+            <member>
+                
+                <link linkend="zoom_rect">zoom_rect</link>
+                
+            </member>
+            
+            <member>
+                
+                <link linkend="rubberbox">rubberbox</link>
+                
+            </member>
+            
             <member>
-                <link linkend="clf">clf</link>
+                
+                <link linkend="axes_properties">axes_properties</link>
+                
             </member>
+            
         </simplelist>
+        
+    </refsection>
+    
+    <refsection>
+        
+        <title>Historique</title>
+        
+        <revhistory>
+            
+            <revision>
+                
+                <revnumber>5.5.0</revnumber>
+                
+                <revdescription>
+                    
+                    <itemizedlist>
+                        
+                        <listitem>
+                            
+                            <para>Extension en 3D</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>Plusieurs repères graphiques peuvent être désormais redimensionnés simultanément</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>
+                                <literal>%nan</literal> peut être utilisé pour spécifier une borne inchangée.
+                            </para>
+                            
+                        </listitem>
+                        
+                    </itemizedlist>
+                    
+                </revdescription>
+                
+            </revision>
+            
+        </revhistory>
+        
     </refsection>
+    
 </refentry>
+
index 44a4571..da60625 100644 (file)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) ENPC - Jean-Philippe Chancelier
+ * Copyright (C) 2013 - Samuel GOUGEON
  * 
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
  *
  -->
+
 <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="replot">
+    
     <refnamediv>
+        
         <refname>replot</refname>
+        
         <refpurpose>カレントのグラフィックウインドウを新しい境界に
+            
             再描画
+            
         </refpurpose>
+        
     </refnamediv>
+    
     <refsynopsisdiv>
+        
         <title>呼び出し手順</title>
-        <synopsis>replot(rect,[handle])</synopsis>
+        
+        <synopsis>replot(area)</synopsis>
+        
+        <synopsis>replot(area, axesHandles)</synopsis>
+        
     </refsynopsisdiv>
+    
     <refsection>
+        
         <title>引数</title>
+        
         <variablelist>
+            
             <varlistentry>
-                <term>rect</term>
+                
+                <term>area</term>
+                
                 <listitem>
+                    
                     <para>大きさ 4の行ベクトル.</para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
             <varlistentry>
-                <term>handle</term>
+                
+                <term>axesHandles</term>
+                
                 <listitem>
+                    
                     <para>オプションの引数. 一つまたは複数のAxesを選択するための
+                        
                         Axes型のグラフィックハンドル.
+                        
                     </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
         </variablelist>
+        
     </refsection>
+    
     <refsection>
+        
         <title>説明</title>
+        
         <para>
+            
             <literal>replot</literal> はカレントのグラフィックウインドウの内容を
-            <literal>rect=[xmin,ymin,xmax,ymax]</literal>で定義した新しい境界内に
+            
+            <literal>area = [xmin,ymin, xmax,ymax]</literal>のかの<literal>area = [xmin,ymin,zmin, xmax,ymax,zmax]</literal>で定義した新しい境界内に
+            
             再描画する際に使用されます.
-            古いグラフィック構文では,<literal>"Rec"</literal>ドライバでのみ
-            動作します.
+            
         </para>
-        <para>この変換はhandle引数でAxesグラフィックハンドルにより指定された特定の軸に  
+        
+        <para>この変換はaxesHandles引数でAxesグラフィックハンドルにより指定された特定の軸に     
+            
             適用されます.
+            
             新しい境界はカレントの図のカレントの軸に適用されます.
+            
             変換はこれらの軸の<literal>data_bounds</literal>の値を変更します.
-            axesのプロパティ<literal>tight_limits</literal>も
-            これらの境界を厳密に選択するために "on" に設定する必要があります
+            
+            axesのプロパティ
+            
+            <note>
+                <literal>tight_limits</literal>も
+                
+                これらの境界を厳密に選択するために "on" に設定する必要があります
+                
+            </note>
+            
             (
+            
             <link linkend="axes_properties">axes_properties</link>を参照ください).
+            
         </para>
+        
     </refsection>
+    
     <refsection>
+        
         <title>例</title>
+        
         <programlisting role="example"><![CDATA[ 
 // 最初の例
 x=[0:0.1:2*%pi]';
 plot2d(x,sin(x)) 
 replot([-1,-1,10,2]) 
       ]]></programlisting>
+        
         <scilab:image>
+            
             x=[0:0.1:2*%pi]';
+            
             plot2d(x,sin(x))
+            
             replot([-1,-1,10,2])
+            
         </scilab:image>
         
+        
+        
         <programlisting role="example"><![CDATA[
 // 二番目の例
 xdel(winsid());
@@ -81,20 +145,139 @@ f=gcf();
 replot([-1,-1,10,2],f.children(1)) // axesハンドルの値を指定
 replot([-3,-2,8,4],f.children(2)) 
  ]]></programlisting>
+        
         <scilab:image>
+            
             xdel(winsid());
+            
             plot()
+            
             f2=gcf();
+            
             replot([-1,-1,10,2],f2.children(1))
+            
             replot([-3,-2,8,4],f2.children(2))
+            
         </scilab:image>
+        
+        <programlisting role="example"><![CDATA[
+//値は%nanで示さ端子は変更されません。
+x = linspace(0,360,200).';
+clf
+plot2d(x,[sind(x) tand(x)])
+ax = gca();
+ax.data_bounds                         // 初期限界
+replot([%nan,-10,%nan,10])     // YminとYmaxのだけ変更され
+ax.data_bounds                         // 新しい制限
+
+// 3D端末Zも変更できます。
+clf
+x = linspace(-4,4,100);
+X = meshgrid(x);
+R = (X-0.5).^2 + (X.'+0.7).^2;
+Z = sinc(R);
+surf(x-0.5,x+0.7,Z)
+f = gcf();
+f.color_map = autumncolormap(100);
+ax = gca();
+ax.data_bounds
+sleep(3000)
+replot([-5 0 -0.4 0 5 0.5])
+ax.data_bounds
+
+// いくつかのグラフィカルなマーカーを同時にトリミングすることができます。
+clf
+x = linspace(-%pi,%pi,400);
+subplot(2,2,1)
+plot2d(x,sin(1 ./sqrt(abs(x))))
+ax1 = gca();
+subplot(2,2,2)
+plot2d(x,sinh(sqrt(abs(x))))
+subplot(2,1,2)
+plot2d(x,cos(1 ./sqrt(abs(x))))
+ax2 = gca();
+sleep(4000)
+f = gcf();
+replot([-1 %nan 1.5 %nan], [ax1 ax2])
+      ]]></programlisting>
+        
+        
+        
+        
+        
     </refsection>
+    
     <refsection role="see also">
+        
         <title>参照</title>
+        
         <simplelist type="inline">
+            
             <member>
-                <link linkend="clf">clf</link>
+                
+                <link linkend="zoom_rect">zoom_rect</link>
+                
             </member>
+            
+            <member>
+                
+                <link linkend="rubberbox">rubberbox</link>
+                
+            </member>
+            
+            <member>
+                
+                <link linkend="axes_properties">axes_properties</link>
+                
+            </member>
+            
         </simplelist>
+        
+    </refsection>
+    
+    <refsection>
+        
+        <title>歴史的</title>
+        
+        <revhistory>
+            
+            <revision>
+                
+                <revnumber>5.5.0</revnumber>
+                
+                <revdescription>
+                    
+                    <itemizedlist>
+                        
+                        <listitem>
+                            
+                            <para>3Dへの拡張</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>いくつかのグラフィック主催者は、今、同時にサイズを変更することができます</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>
+                                <literal>%nan</literal>であるように、結合を維持するために使用することができる。
+                            </para>
+                            
+                        </listitem>
+                        
+                    </itemizedlist>
+                    
+                </revdescription>
+                
+            </revision>
+            
+        </revhistory>
+        
     </refsection>
+    
 </refentry>
+
index 60b65f9..bf02cb4 100644 (file)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
+
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) ENPC - Jean-Philippe Chancelier
+ * Copyright (C) 2013 - Samuel GOUGEON
  * 
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="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="replot" xml:lang="en">
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="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="replot" xml:lang="pt">
+    
     <refnamediv>
+        
         <refname>replot</refname>
-        <refpurpose>redesenha a janela de gráficos corrente com novas
-            fronteiras
+        
+        <refpurpose>reformula a área de exibição de um ou mais gráficos
+            
         </refpurpose>
+        
     </refnamediv>
+    
     <refsynopsisdiv>
+        
         <title>Seqüência de Chamamento</title>
-        <synopsis>replot(rect,[handle])</synopsis>
+        
+        <synopsis>replot(area)</synopsis>
+        
+        <synopsis>replot(area, axesHandles)</synopsis>
+        
     </refsynopsisdiv>
+    
     <refsection>
+        
         <title>Parâmetros</title>
+        
         <variablelist>
+            
             <varlistentry>
-                <term>rect</term>
+                
+                <term>area</term>
+                
                 <listitem>
+                    
                     <para>vetor linha de tamanho 4.</para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
             <varlistentry>
-                <term>handle</term>
+                
+                <term>axesHandles</term>
+                
                 <listitem>
+                    
                     <para>argumento opcional. Manipulador(es) do tipo Axes para
+                        
                         selecionar uma ou várias entidades Axes válidas. Disponível apenas
+                        
                         no novo modo de gráficos.
+                        
                     </para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
         </variablelist>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Descrição</title>
+        
         <para>
+            
             <literal>replot</literal> é utilizado para redesenhar o conteúdo da
+            
             janela de gráficos atual com novas fronteiras definidas por
-            <literal>rect=[xmin,ymin,xmax,ymax]</literal>. Sob a sintaxe de gráficos
-            antiga, funciona apenas com o driver <literal>"Rec"</literal>.
+            
+            <literal>area = [xmin,ymin,xmax,ymax]</literal> ou <literal> rect = [xmin, ymin, zmin, xmax, ymax, zmax] </literal>. 
+            
         </para>
+        
         <para>Sob o novo modo de gráficos, esta transformação pode ser aplicada a
+            
             eixos específicos fornecidos por manipuladores gráficos Axes via o
-            argumento handle. Se handle não for especificado, as novas fronteiras são
+            
+            argumento <varname>axesHandles</varname>. Se <varname>axesHandles</varname> 
+            
+            não for especificado, as novas fronteiras são
+            
             aplicadas aos eixos correntes da figura corrente. A transformação muda os
-            valores de <literal>data_bounds</literal> para estes eixos. Note que a
-            propriedade de eixos <literal>tight_limits</literal> também deve ser
-            ajustada para "on" para selecionar estritamente estas fronteiras (ver
-            <link linkend="axes_properties">axes_properties</link>).<literal>
-            </literal>
+            
+            valores de <literal>data_bounds</literal> para estes eixos. 
+            
+            <note>
+                A propriedade de eixos <literal>tight_limits</literal> também deve ser
+                
+                ajustada para "on" para selecionar estritamente estas fronteiras (ver
+                
+                <link linkend="axes_properties">axes_properties</link>).
+                
+            </note>
+            
         </para>
+        
     </refsection>
+    
     <refsection>
+        
         <title>Exemplos</title>
+        
         <programlisting role="example"><![CDATA[ 
 // primeiro exemplo
 x=[0:0.1:2*%pi]';
@@ -75,13 +131,144 @@ f=gcf();
 replot([-1,-1,10,2],f.children(1)) // especificando o valor do manipulador dos eixos
 replot([-3,-2,8,4],f.children(2)) 
  ]]></programlisting>
+        
+        <programlisting role="example"><![CDATA[
+// ?????
+xdel(winsid());
+plot() // plot demo
+f=gcf();
+replot([-1,-1,10,2],f.children(1)) // axes?????????
+replot([-3,-2,8,4],f.children(2)) 
+ ]]></programlisting>
+        
+        <scilab:image>
+            
+            xdel(winsid());
+            
+            plot()
+            
+            f2=gcf();
+            
+            replot([-1,-1,10,2],f2.children(1))
+            
+            replot([-3,-2,8,4],f2.children(2))
+            
+        </scilab:image>
+        
+        <programlisting role="example"><![CDATA[
+// Os fronteiras indicadas pelo valor %nan não são alterados:
+x = linspace(0,360,200).';
+clf
+plot2d(x,[sind(x) tand(x)])
+ax = gca();
+ax.data_bounds                         // Fronteiras iniciais
+replot([%nan,-10,%nan,10])     // Ymin e Ymax só são modificados
+ax.data_bounds                         // novas fronteiras
+
+// 3D Fronteiras Z também pode ser modificadas :
+clf
+x = linspace(-4,4,100);
+X = meshgrid(x);
+R = (X-0.5).^2 + (X.'+0.7).^2;
+Z = sinc(R);
+surf(x-0.5,x+0.7,Z)
+f = gcf();
+f.color_map = autumncolormap(100);
+ax = gca();
+ax.data_bounds
+sleep(3000)
+replot([-5 0 -0.4 0 5 0.5])
+ax.data_bounds
+
+// Diversos gráficos podem ser cortadas simultaneamente :
+clf
+x = linspace(-%pi,%pi,400);
+subplot(2,2,1)
+plot2d(x,sin(1 ./sqrt(abs(x))))
+ax1 = gca();
+subplot(2,2,2)
+plot2d(x,sinh(sqrt(abs(x))))
+subplot(2,1,2)
+plot2d(x,cos(1 ./sqrt(abs(x))))
+ax2 = gca();
+sleep(4000)
+f = gcf();
+replot([-1 %nan 1.5 %nan], [ax1 ax2])
+      ]]></programlisting>
+        
     </refsection>
+    
     <refsection role="see also">
+        
         <title>Ver Também</title>
+        
         <simplelist type="inline">
+            
             <member>
-                <link linkend="clf">clf</link>
+                
+                <link linkend="zoom_rect">zoom_rect</link>
+                
             </member>
+            
+            <member>
+                
+                <link linkend="rubberbox">rubberbox</link>
+                
+            </member>
+            
+            <member>
+                
+                <link linkend="axes_properties">axes_properties</link>
+                
+            </member>
+            
         </simplelist>
+        
     </refsection>
+    
+    <refsection>
+        
+        <title>histórico</title>
+        
+        <revhistory>
+            
+            <revision>
+                
+                <revnumber>5.5.0</revnumber>
+                
+                <revdescription>
+                    
+                    <itemizedlist>
+                        
+                        <listitem>
+                            
+                            <para>Extensão para o 3D</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>Vários coordenadas gráficos podem agora ser redimensionadas simultaneamente</para>
+                            
+                        </listitem>
+                        
+                        <listitem>
+                            
+                            <para>
+                                <literal>%nan</literal> pode ser usado para manter um limite como está.
+                            </para>
+                            
+                        </listitem>
+                        
+                    </itemizedlist>
+                    
+                </revdescription>
+                
+            </revision>
+            
+        </revhistory>
+        
+    </refsection>
+    
 </refentry>
+
index a3f80f7..72da06f 100644 (file)
@@ -1,5 +1,7 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) INRIA
+// Copyright (C) 2013 - Samuel GOUGEON : extend to 3D + set of handles + skip with %nan
+
 // This file must be used under the terms of the CeCILL.
 // This source file is licensed as described in the file COPYING, which
 // you should have received as part of this distribution.  The terms
@@ -7,28 +9,43 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 
 function replot(rect,handl)
-    // replots the graphic window win
-    // using rect as x and y bounds
-
+    // replots the graphic axes using rect as x and y (and z) bounds
+    //
 
-    [lhs,rhs]=argn(0);
+    [lhs,rhs] = argn(0);
 
     if rhs < 1 then
-        error(msprintf(gettext("%s: Wrong number of input argument(s): %d or %d expected.\n"), "replot", 1, 2));
+        msg = _("%s: Wrong number of input argument(s): %d or %d expected.\n")
+        error(msprintf(msg, "replot", 1, 2));
     end
 
     if rhs == 1
-        a=gca();
+        a = gca();
     else
         if (type(handl) == 9)
-            if (handl.type == "Axes")
+            if and(handl.type == "Axes")
                 a = handl;
             else
-                error(msprintf(gettext("%s: Input argument #%d must be a handle on an axis.\n"), "replot", 2));
+                msg = _("%s: Input argument #%d must be a handle on an axis.\n")
+                error(msprintf(msg, "replot", 2));
             end
         else
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Graphic handle expected.\n"), "replot", 2));
+            msg = _("%s: Wrong type for input argument #%d: Graphic handle expected.\n")
+            error(msprintf(msg, "replot", 2));
+        end
+    end
+    if length(rect)==4 then
+        rect = [rect(1) rect(2) ; rect(3) rect(4)]
+    elseif length(rect)==6
+        rect = [rect(1) rect(2) rect(3); rect(4) rect(5) rect(6)]
+    end
+    k = ~isnan(rect)
+
+    for i = 1:length(a)
+        if length(rect)==4 then
+            a(i).data_bounds(k) = rect(k)
+        elseif length(rect)==6 & a(i).view=="3d"
+            a(i).data_bounds(k) = rect(k)
         end
     end
-    a.data_bounds = [rect(1) rect(2) ; rect(3) rect(4)]
 endfunction