Fix help issues (warnings + wrong format in files)
[scilab.git] / scilab / modules / graphics / help / en_US / axes_operations / replot.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ENPC - Jean-Philippe Chancelier
5  * Copyright (C) 2013 - Samuel GOUGEON
6  * 
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at    
11  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12  *
13  -->
14 <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">
15     <refnamediv>
16         <refname>replot</refname>
17         <refpurpose>redraw with new boundaries the current or a given set of axes
18         </refpurpose>
19     </refnamediv>
20     <refsynopsisdiv>
21         <title>Calling Sequence</title>
22         <synopsis>replot(area)</synopsis>
23         <synopsis>replot(area, axesHandles)</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>area</term>
30                 <listitem>
31                     <para>row vector [xmin ymin xmax ymax] or [xmin ymin zmin xmax ymax zmax]: new bounds of the area to be replotted. 
32                         <note>
33                             Use <literal>%nan</literal> to keep a bound as is.
34                         </note>
35                     </para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>axeHandle</term>
40                 <listitem>
41                     <para>Vector of graphics handles of type Axes: Axes to crop. By default, the current Axes of the current figure is considered.
42                     </para>
43                 </listitem>
44             </varlistentry>
45         </variablelist>
46     </refsection>
47     <refsection>
48         <title>Description</title>
49         <para>
50             <literal>replot</literal> is used to redraw the content of the current graphics axes with new boundaries defined by
51             <literal>area = [xmin,ymin, xmax,ymax]</literal> or <literal>area = [xmin,ymin,zmin, xmax,ymax,zmax]</literal>. 
52         </para>
53         <para>This transformation can be applied to specific
54             axes given by Axes graphics handles via the <varname>axesHandles</varname> argument. If <varname>axesHandles</varname> is
55             not specified, the new boundaries are applied to the current axes of the
56             current figure. The transformation changes the <literal>data_bounds</literal>
57             value of those axes.
58         </para>
59         <note>
60             The axes property <literal>tight_limits</literal>
61             must be set to "on" to strictly select specified bounds (see
62             <link linkend="axes_properties">axes_properties</link>)
63         </note>
64     </refsection>
65     <refsection>
66         <title>Examples</title>
67         <programlisting role="example"><![CDATA[
68       x=[0:0.1:2*%pi]';
69       plot2d(x,sin(x))
70       replot([-1,-1,10,2])
71       ]]></programlisting>
72         <scilab:image>
73             x=[0:0.1:2*%pi]';
74             plot2d(x,sin(x))
75             replot([-1,-1,10,2])
76         </scilab:image>
77         <programlisting role="example"><![CDATA[
78       xdel(winsid());
79       plot() // plot demo
80       f=gcf();
81       replot([-1,-1,10,2],f.children(1)) // specify axes handle's value
82       replot([-3,-2,8,4],f.children(2))
83       ]]></programlisting>
84         <scilab:image>
85             xdel(winsid());
86             plot()
87             f2=gcf();
88             replot([-1,-1,10,2],f2.children(1))
89             replot([-3,-2,8,4],f2.children(2))
90         </scilab:image>
91         <programlisting role="example"><![CDATA[
92 // Leaving some bounds as is with %nan:
93 x = linspace(0,360,200).';
94 clf
95 plot2d(x,[sind(x) tand(x)])
96 ax = gca();
97 ax.data_bounds                          // initial bounds
98 replot([%nan,-10,%nan,10])      // only Ymin and Ymax are changed
99 ax.data_bounds                          // updated bounds
100 // Resizing Z bounds as well as X and Y ones in 3D view:
101 clf
102 x = linspace(-4,4,100);
103 X = meshgrid(x);
104 R = (X-0.5).^2 + (X.'+0.7).^2;
105 Z = sinc(R);
106 surf(x-0.5,x+0.7,Z)
107 f = gcf();
108 f.color_map = autumncolormap(100);
109 ax = gca();
110 ax.data_bounds
111 sleep(3000)
112 replot([-5 0 -0.4 0 5 0.5])
113 ax.data_bounds
114 // Resizing several chosen axes together:
115 clf
116 x = linspace(-%pi,%pi,400);
117 subplot(2,2,1)
118 plot2d(x,sin(1 ./sqrt(abs(x))))
119 ax1 = gca();
120 subplot(2,2,2)
121 plot2d(x,sinh(sqrt(abs(x))))
122 subplot(2,1,2)
123 plot2d(x,cos(1 ./sqrt(abs(x))))
124 ax2 = gca();
125 sleep(4000)
126 f = gcf();
127 replot([-1 %nan 1.5 %nan], [ax1 ax2])
128       ]]></programlisting>
129     </refsection>
130     <refsection role="see also">
131         <title>See Also</title>
132         <simplelist type="inline">
133             <member>
134                 <link linkend="zoom_rect">zoom_rect</link>
135             </member>
136             <member>
137                 <link linkend="rubberbox">rubberbox</link>
138             </member>
139             <member>
140                 <link linkend="axes_properties">axes_properties</link>
141             </member>
142         </simplelist>
143     </refsection>
144     <refsection>
145         <title>History</title>
146         <revhistory>
147             <revision>
148                 <revnumber>5.5.0</revnumber>
149                 <revdescription>
150                     <itemizedlist>
151                         <listitem>Extension to 3D
152                         </listitem>
153                         <listitem>axesHandles vectorized
154                         </listitem>
155                         <listitem>
156                             <literal>%nan</literal> can be used to keep a bound as is.
157                         </listitem>
158                     </itemizedlist>
159                 </revdescription>
160             </revision>
161         </revhistory>
162     </refsection>
163 </refentry>