Update unzoom and zoom_rect help pages. Warning message appeared: Syntax vector ...
[scilab.git] / scilab / modules / graphics / help / en_US / axes_operations / zoom_rect.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) INRIA - Serge Steer
5  * Copyright (C) INRIA - 2008 - Jean-Baptiste Silvy
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="zoom_rect">
15     <refnamediv>
16         <refname>zoom_rect</refname>
17         <refpurpose>zoom a selection of the current graphic figure</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>zoom_rect()
22             zoom_rect(rect)
23             zoom_rect(h)
24             zoom_rect(h,rect)
25         </synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>rect</term>
32                 <listitem>
33                     <para>
34                         Vector of size 4 <literal>[xmin,ymin,xmax,ymax]</literal> give the
35                         rectangle to be zoomed.
36                     </para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>h</term>
41                 <listitem>
42                     <para>Graphic handle of type Figure or Axes. Specify on which Axes
43                         the zoom will apply.
44                     </para>
45                 </listitem>
46             </varlistentry>
47         </variablelist>
48     </refsection>
49     <refsection>
50         <title>Description</title>
51         <para>
52             <literal>zoom_rect</literal> function is used to perform a zoom inside a set of Axes Objects.
53         </para>
54         <para>
55             The <literal>h</literal> input argument specifies on which Axes the zoom will apply.
56             If <literal>h</literal> is a Figure handle then the zoom will apply on its Axes children.
57             If <literal>h</literal> is a Axes handle then the zoom will only apply to this handle.
58             If <literal>h</literal> is not specified, then the zoom is performed on the current Figure.
59         </para>
60         <para>
61             If <literal>rect</literal> input argument is specified then the zoomed Axes <literal>zoom_box</literal>
62             property is modified by the argument (see  <link linkend="axes_properties">axes_properties</link>).
63             Its bounds along X and Y axis are replaced by <literal>rect</literal>.
64             If <literal>rect</literal> is not specified zoom_rect is an interactive zoom. User is required to select
65             a rectangle using the mouse. The new <literal>zoom_box</literal> property of zoomed axes are then computed
66             by finding the intersections of the rectangle with their axes boxe.
67         </para>
68     </refsection>
69     <refsection>
70         <title>Examples</title>
71         <programlisting role="example"><![CDATA[ 
72 clf()
73 x=0:0.01:6*%pi;
74 plot2d(x,sin(x.^2))
75 zoom_rect([16,-1,18,1])
76 //more zoom
77 zoom_rect([16,0,16.2,1])
78 //back to the original
79 unzoom()
80 // zooming using axes_properties
81 a=gca();
82 a.zoom_box=[16,0,16.2,1];
83 a.zoom_box=[];
84
85 //zooming subplots accordingly
86 clf()
87 x=0:0.01:6*%pi;
88 subplot(211)
89 plot2d(x,cos(x))
90 subplot(212)
91 plot2d(x,cos(2*x))
92 rect=[3 -2 7 10]; //a rectangle specified in the current axes (last one) coordinates
93 zoom_rect(rect) 
94 unzoom()
95 //set the global underlying axes as current
96 f=gcf();set('current_axes',f.children($)) 
97 rect=[0.4 0 0.6 1] //a rectangle specified in ratio of the window size
98 zoom_rect(rect) 
99 rect=[0.4 0.2 0.6 0.8]; //a rectangle specified in ratio of the window size
100 zoom_rect(rect)
101
102 // interactive zoom on current figure
103 zoom_rect();
104 // or
105 zoom_rect(gcf());
106  ]]></programlisting>
107     </refsection>
108     <refsection role="see also">
109         <title>See Also</title>
110         <simplelist type="inline">
111             <member>
112                 <link linkend="unzoom">unzoom</link>
113             </member>
114             <member>
115                 <link linkend="axes_properties">axes_properties</link>
116             </member>
117         </simplelist>
118     </refsection>
119 </refentry>