~ubuntu-branches/ubuntu/trusty/scilab/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) ENPC - Jean-Philippe Chancelier
 * 
 * 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-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" version="5.0-subset Scilab" xml:lang="en" xml:id="xsetech">
  <refnamediv>
    <refname>xsetech</refname>
    <refpurpose> set the sub-window of a graphics window for plotting</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>xsetech(wrect,[frect,logflag])
      xsetech(wrect=[...],frect=[..],logflag="..", arect=[...])
      xsetech()
    </synopsis>
  </refsynopsisdiv>
  <refsection>
    <title>Arguments</title>
    <variablelist>
      <varlistentry>
        <term>wrect</term>
        <listitem>
          <para>vector of size 4, defining the sub-window to use.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>frect</term>
        <listitem>
          <para>vector of size 4.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>logflag</term>
        <listitem>
          <para>string of size 2 "xy", where x and y can be "n" or "l". "n" stands for  normal and "l" stands for logscale. x stands for the x-axis and y stands for the y-axis.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>arect</term>
        <listitem>
          <para>vector of size 4.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>
  <refsection>
    <title>Description</title>
    <para>
      <literal>xsetech</literal> is mainly used to set the sub-window of the graphics
      window which will be used for plotting. The sub-window is specified
      with the parameter <literal>wrect=[x,y,w,h]</literal> (upper-left point, width,
      height).  The values in <literal>wrect</literal> are specified using proportion of
      the width or height of the current graphic window. For instance
      <literal>wrect=[0,0,1,1]</literal> means that the whole graphics window will be
      used, and <literal>wrect=[0.5,0,0.5,1]</literal> means that the graphics region
      will be the right half of the graphics window.
    </para>
    <para>
      <literal>xsetech</literal> also set the current graphics scales for 2D plotting and
      can be used in conjunction with graphics routines which request the
      current graphics scale (for instance <literal>strf="x0z"</literal>
      or<literal>frameflag=0</literal> in <literal>plot2d</literal>).
    </para>
    <para>
      <literal>frect=[xmin,ymin,xmax,ymax]</literal> is used to set the graphics scale
      and is just like the <literal>rect</literal> argument of <literal>plot2d</literal>. If
      <literal>frect</literal> is not given the current value of the graphic scale
      remains unchanged. the default value of <literal>rect</literal> is <literal>[0,0,1,1]</literal>
      (at window creation, when switching back to default value with
      <literal>xset('default')</literal> or when clearing graphic recorded events
      <literal>clf()</literal>).
    </para>
    <para>
      <literal>arect=[x_left, x_right,y_up,y_down]</literal> is used to set the graphic
      frame inside the subwindow. The graphic frame is specified (like
      <literal>wrect</literal>) using proportion of the width or height of the current
      graphic subwindow.  Default value is <literal>1/8*[1,1,1,1]</literal>. If
      <literal>arect</literal> is not given, current value remains unchanged.
    </para>
  </refsection>
  <refsection>
    <title>Sample</title>
    <scilab:image>
      xset("font",2,0)
      xsetech([0,0,0.5,0.5]);
      plot3d()
      xsetech([0.5,0,0.5,0.5]);
      plot2d()
      xsetech([0.5,0.5,0.5,0.5]);
      grayplot()
      xsetech([0,0.5,0.5,0.5]);
      histplot()
      xsetech([0,0,1,1])
    </scilab:image>
  </refsection>
  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[ 
// To get a graphical explanation of xsetech parameters enter:
exec('SCI/modules/graphics/demos/xsetechfig.sce');

// Here xsetech is used to split the graphics window in two parts 
// first xsetech is used to set the first sub-window 
// and the graphics scale 
xsetech([0,0,1.0,0.5],[-5,-3,5,3])
// we call plot2d with the "001" option to use the graphics scale 
// set by xsetech 
plot2d([1:10]',[1:10]',1,"001"," ")
// then xsetech is used to set the second sub-window 
xsetech([0,0.5,1.0,0.5])
// the graphics scale is set by xsetech to [0,0,1,1] by default 
// and we change it with the use of the rect argument in plot2d 
plot2d([1:10]',[1:10]',1,"011"," ",[-6,-6,6,6])
 ]]></programlisting>
    <programlisting role="example"><![CDATA[ 
// Four plots on a single graphics window 
clf()
xset("font",2,0)
xsetech([0,0,0.5,0.5]);
plot3d()
xsetech([0.5,0,0.5,0.5]);
plot2d()
xsetech([0.5,0.5,0.5,0.5]);
grayplot()
xsetech([0,0.5,0.5,0.5]);
histplot()
// back to default values for the sub-window 
xsetech([0,0,1,1])
 ]]></programlisting>
    <programlisting role="example"><![CDATA[ 
// One plot with changed arect 
clf()
xsetech(arect=[0,0,0,0]) 
x=1:0.1:10;plot2d(x',sin(x)')
 ]]></programlisting>
    <programlisting role="example"><![CDATA[ 
clf()
xsetech(arect=[1/8,1/8,1/16,1/4])
x=1:0.1:10;plot2d(x',sin(x)')
clf()
 ]]></programlisting>
  </refsection>
  <refsection role="see also">
    <title>See Also</title>
    <simplelist type="inline">
      <member>
        <link linkend="xgetech">xgetech</link>
      </member>
      <member>
        <link linkend="subplot">subplot</link>
      </member>
      <member>
        <link linkend="isoview">isoview</link>
      </member>
      <member>
        <link linkend="square">square</link>
      </member>
    </simplelist>
  </refsection>
</refentry>