Typo fixes
[scilab.git] / scilab / modules / graphics / help / en_US / bar_histogram / barhomogenize.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 - Farid Belahcene
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <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="barhomogenize">
14     <refnamediv>
15         <refname>barhomogenize</refname>
16         <refpurpose>homogenize all the bars included in the current working axes</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>barhomogenize()
21             barhomogenize([h[,'style'[,'width']]])
22         </synopsis>
23     </refsynopsisdiv>
24     <refsection>
25         <title>Arguments</title>
26         <variablelist>
27             <varlistentry>
28                 <term>h</term>
29                 <listitem>
30                     <para>an axes handle, (default: h=gca() ).</para>
31                 </listitem>
32             </varlistentry>
33             <varlistentry>
34                 <term>style</term>
35                 <listitem>
36                     <para>a string, 'grouped' or 'stacked' (default: 'grouped').</para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>width</term>
41                 <listitem>
42                     <para>(optional), a real scalar, defines the width (a percentage of
43                         the available room) for the bar (default: 0.8).
44                     </para>
45                 </listitem>
46             </varlistentry>
47         </variablelist>
48     </refsection>
49     <refsection>
50         <title>Description</title>
51         <para>
52             If there are several bar calls, the <literal>barhomogenize</literal> function
53             allows to homogenize the width and style of all bars (i.e which has the
54             <literal>polyline_style</literal> type 6) included in the current working axes.
55             These bars must have the same x data.
56         </para>
57         <para>
58             <literal>barhomogenize( ) :</literal> takes the default values, h=gca(),
59             width=0.8, style='grouped'. <literal/>
60         </para>
61         <para>
62             <literal>barhomogenize(h,...) :</literal> defines the current axes where the
63             drawing is performed.
64         </para>
65         <para>
66             <literal>barhomogenize(...,width,...) :</literal> defines the width of the
67             bar(s) in percentage (generally: 0&lt;width&lt;=1).
68         </para>
69         <para>
70             <literal>barhomogenize(...,style,...) :</literal> defines how the bars are
71             drawn. The 'grouped' option allows to center the M polylines versus each
72             components of x, and the 'stacked' option allows to stack them.
73         </para>
74     </refsection>
75     <refsection>
76         <title>Examples</title>
77         <programlisting role="example"><![CDATA[
78 // First example: creation of 1 yellow bar (i.e 1 polyline with polyline_style=6) and 3 bars (i.e 3 polylines with polyline_style=6)
79 subplot(2,3,1)
80 xtitle('ex1: creation of 1 yellow bar and 3 bars')
81 x=1:3;
82 y1=1:3;
83 y2=[4 3 5;6 7 8;9 10 11];
84 bar(x,y1,'yellow');bar(x,y2);
85
86 // grouped homogenization of these 4 bars
87 subplot(2,3,2)
88 xtitle('grouped homogenization')
89 x=1:3;
90 y1=1:3;
91 y2=[4 3 5;6 7 8;9 10 11];
92 bar(x,y1,'yellow');bar(x,y2);
93 barhomogenize();
94
95 // stacked homogenization of the 4 bars
96 subplot(2,3,3)
97 xtitle('stacked homogenization')
98 x=1:3; y1=1:3; y2=[4 3 5;6 7 8;9 10 11];
99 bar(x,y1,'yellow');bar(x,y2);
100 barhomogenize('stacked',1);
101 ]]></programlisting>
102         <scilab:image>
103             subplot(2,3,1)
104             xtitle('ex1: creation of 1 yellow bar and 3 bars')
105             x=1:3;
106             y1=1:3;
107             y2=[4 3 5;6 7 8;9 10 11];
108             bar(x,y1,'yellow');bar(x,y2);
109             
110             subplot(2,3,2)
111             xtitle('grouped homogenization')
112             x=1:3;
113             y1=1:3;
114             y2=[4 3 5;6 7 8;9 10 11];
115             bar(x,y1,'yellow');bar(x,y2);
116             barhomogenize();
117             
118             subplot(2,3,3)
119             xtitle('stacked homogenization')
120             x=1:3; y1=1:3; y2=[4 3 5;6 7 8;9 10 11];
121             bar(x,y1,'yellow');bar(x,y2);
122             barhomogenize('stacked',1);
123         </scilab:image>
124         
125         <programlisting role="example"><![CDATA[
126 // Second example : creation of 1 red bar (i.e 1 polyline with polyline_style=6) and 2 polylines with type=1 (calling plot function)
127 subplot(2,3,4)
128 xtitle('ex2: creation of 1 bar and 2 polylines')
129 x=1:10;
130 y=sin(x)/2;
131 bar(x,y,'red')
132 x1=1:10;
133 y1=[sin(x);cos(x)]
134 plot(x1',y1')
135
136 // modify the polyline_style type of the second polyline from plot (this polyline becomes a bar)
137 subplot(2,3,5)
138 xtitle('transformation of the second polyline to bar')
139 x=1:10;
140 y=sin(x)/2;
141 bar(x,y,'red')
142 x1=1:10;
143 y1=[sin(x);cos(x)]
144 plot(x1',y1')
145 e=gce();
146 e2=e.children(2);
147 e2.polyline_style=6;
148
149 // homogenization of the first bar (from bar function) and second bar (from the modification).
150 subplot(2,3,6)
151 xtitle('grouped homogenization')
152 x=1:10;
153 y=sin(x)/2;
154 bar(x,y,'red')
155 x1=1:10;
156 y1=[sin(x);cos(x)]
157 plot(x1',y1')
158 e=gce();
159 e2=e.children(2);
160 e2.polyline_style=6;
161 barhomogenize();
162 // change the style and the width
163 //barhomogenize('stacked',0.5);
164 //barhomogenize('stacked',1);
165  ]]></programlisting>
166         <scilab:image>
167             // Second example : creation of 1 red bar (i.e 1 polyline with polyline_style=6) and 2 polylines with type=1 (calling plot function)
168             subplot(2,3,4)
169             xtitle('ex2: creation of 1 bar and 2 polylines')
170             x=1:10;
171             y=sin(x)/2;
172             bar(x,y,'red')
173             x1=1:10;
174             y1=[sin(x);cos(x)]
175             plot(x1',y1')
176             
177             // modify the polyline_style type of the second polyline from plot (this polyline becomes a bar)
178             subplot(2,3,5)
179             xtitle('transformation of the second polyline to bar')
180             x=1:10;
181             y=sin(x)/2;
182             bar(x,y,'red')
183             x1=1:10;
184             y1=[sin(x);cos(x)]
185             plot(x1',y1')
186             e=gce();
187             e2=e.children(2);
188             e2.polyline_style=6;
189             
190             // homogenization of the first bar (from bar function) and second bar (from the modification).
191             subplot(2,3,6)
192             xtitle('grouped homogenization')
193             x=1:10;
194             y=sin(x)/2;
195             bar(x,y,'red')
196             x1=1:10;
197             y1=[sin(x);cos(x)]
198             plot(x1',y1')
199             e=gce();
200             e2=e.children(2);
201             e2.polyline_style=6;
202             barhomogenize();
203             // change the style and the width
204             //barhomogenize('stacked',0.5);
205             //barhomogenize('stacked',1);
206         </scilab:image>
207     </refsection>
208     <refsection role="see also">
209         <title>See Also</title>
210         <simplelist type="inline">
211             <member>
212                 <link linkend="bar">bar</link>
213             </member>
214             <member>
215                 <link linkend="polyline_properties">polyline_properties</link>
216             </member>
217         </simplelist>
218     </refsection>
219 </refentry>