1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Djalel Abdemouche
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-en.txt
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" version="5.0-subset Scilab" xml:lang="en" xml:id="polyline_properties">
15 <refname>polyline_properties</refname>
16 <refpurpose>description of the Polyline
21 <title>Description</title>
22 <para>The Polyline entity is a leaf of the graphics entities hierarchy. This
23 entity defines the parameters for polylines.
29 <para>This field contains the handle of the parent. The parent of the
30 polyline entity should be of the type <literal>"Axes"</literal> or
31 <literal>"Compound"</literal>.
36 <term>children: </term>
39 This property contains a vector with the <literal>children</literal> of
40 the handle. However, polyline handles currently do not have any
41 <literal>children</literal>.
46 <term>visible: </term>
49 This field contains the <literal>visible</literal> property value for
50 the entity . It should be <literal>"on" </literal> or <literal>"off"</literal> .
51 By default, the polyline is visible, the value's property is
52 <literal>"on" </literal>. If <literal>"off"</literal> the polyline is not drawn on
60 <para>This field contains the values for the x and y coordinates.
61 Component Z is to be added in the case of three-dimensional axes. It
62 is a two (three) column matrix <literal>[x,y,[z]]</literal> of points.
69 <para>This field determines wether the polyline is closed or not: its
70 value can be <literal>"on"</literal> or <literal>"off"</literal> (no default
71 value, it depends on the primitive used to create the polyline).
76 <term>line_mode: </term>
79 This field contains the default <literal>line_mode</literal> property
80 value for the polyline. Its value should be <literal>"on" </literal>(line
81 drawn) or <literal>"off"</literal> (no line drawn).
86 <term>fill_mode: </term>
89 If the <literal>polyline_style</literal> field is different of 5, fill
90 the background of the curve with color defined by the
91 <literal>background</literal> property.
96 <term>line_style: </term>
99 The <literal>line_style</literal> property value should be an integer in
100 [1 8]. 1 stands for solid, the other value stands for a selection of
101 dashes (see <link linkend="axes_properties">getlinestyle</link>).
106 <term>thickness: </term>
108 <para>This property is a positive real specifying the line width
109 in pixels. The displayed width is actually determined by rounding the supplied width
110 to the nearest integer. The only exception is vectorial export where the whole <literal>thickness</literal>
116 <term>arrow_size_factor: </term>
118 <para>This integer allows to set the size of arrows drawn on the
119 polyline. The actual size of arrows is the product of the
120 <literal>thickness</literal> and the size factor.
125 <term>polyline_style: </term>
127 <para>This property sets several polyline drawing mode:</para>
130 <para>If the value is 0 or 1 lines are drawn between two
135 <para>If the value is 2 the polyline produces a staircase plot. Two
136 consecutives points are linked by a horizontal line followed by a
141 <para>If the value is 3 the polyline produces a bar plot. For each
142 given point (x,y) a vertical line is drawn from (x,y) to
147 <para>If the value is 4 arrows are drawn between two consecutives
152 <para>If the value is 5 the polyline is filled (patch).</para>
155 <para>If the value is 6 the polyline is a Matlab-like bar object.
156 The properties <literal>bar_shift</literal> and <literal>bar_width</literal>
157 command its appearance.
164 <imagedata fileref="../../images/polyline_style.svg"/>
171 <term>foreground: </term>
174 This field contains the default <literal>foreground</literal> property
175 used to draw the polyline. Its value should be a color index (relative
176 to the current colormap).
181 <term>background: </term>
183 <para>This field contains the color used to fill the background of the
184 polyline. Its value should be a color index (relative to the current
190 <term>interp_color_vector: </term>
192 <para>This field contains the vector of color indices used to fill in
193 the polyline when the <literal>interp_color_mode</literal> property is set
194 to <literal>"on"</literal>. It defines the intervals of colormap indices
195 used to fill each segment. For instance, the first segment will be
196 filled by every colors whose index is between the first two elements
197 of the vector. It is only applicable if the polyline is defined by 3 or
198 4 points. Therefore, the size of the vector must match this
204 <term>interp_color_mode: </term>
206 <para>This field determines if we are using the interpolated shading
207 mode to fill the polyline : its value can be <literal>"on"</literal> or
208 <literal>"off"</literal>. Note that an <literal>interp_color_vector</literal> must
209 be defined before switching to "on" value (see above).
214 <term>mark_mode: </term>
217 This field contains the default <literal>mark_mode</literal> property
218 value for the polyline. Its value should be <literal>"on"</literal> (marks
219 drawn) or <literal>"off"</literal> (no marks drawn).
224 <term>mark_style: </term>
227 The <literal>mark_style</literal> property value is used to select the
228 type of mark to use when <literal>mark_mode</literal> property is
229 <literal>"on"</literal>. The value should be an integer in [0 14] which
230 stands for: dot, plus, cross, star, filled diamond, diamond, triangle
231 up, triangle down, diamond plus, circle, asterisk, square, triangle
232 right, triangle left and pentagram. The figure below shows the aspects of the marks depending on the <literal>mark_style</literal> and the <literal>mark_foreground</literal> and <literal>mark_background</literal> properties.
237 <imagedata fileref="../../images/marks.svg"/>
244 <term>mark_size_unit: </term>
247 This field contains the default <literal>mark_size_unit</literal>
248 property value. If <literal>mark_size_unit</literal> is set to
249 <literal>"point"</literal>, then the <literal>mark_size</literal> value is
250 directly given in points. When <literal>mark_size_unit</literal> is set to
251 <literal>"tabulated"</literal>, <literal>mark_size</literal> is computed relative
252 to the font size array: therefore, its value should be an integer in
253 [0 5] which stands for 8pt, 10pt, 12pt, 14pt, 18pt and 24pt. Note that
254 <link linkend="plot2d">plot2d</link> and pure scilab functions use
255 <literal>tabulated</literal> mode as default ; when using <link linkend="plot">plot</link>
256 function, the <literal>point</literal> mode is automatically enabled.
261 <term>mark_size: </term>
264 The <literal>mark_size</literal> property is used to select the type of
265 size of the marks when <literal>mark_mode</literal> property is
266 <literal>"on"</literal>. Its value should be an integer between 0 and 5
267 whith stands for 8pt, 10pt, 12pt, 14pt, 18pt and 24pt.
272 <term>mark_foreground: </term>
275 This field contains the <literal>mark_foreground</literal> property
276 value which is the marks' edge color. Its value should be a color
277 index (relative to the current color_map) or 0 for transparant edge.
282 <term>mark_background: </term>
285 This field contains the <literal>mark_background</literal> property
286 value which is the marks' face color. Its value should be a color
287 index (relative to the current color_map) or 0 for transparant face.
292 <term>x_shift: </term>
294 <para>This field contains the offset computed by a call to the
295 <link linkend="bar">bar</link> function (or re-computed by a call to
296 <link linkend="barhomogenize">barhomogenize</link>) and is used to perform a nice vertical bar
297 representation. Note that this offset is also taken into account for
298 all the other <literal>polyline_style</literal>. The unit is expressed in
304 <term>y_shift: </term>
306 <para>This field contains the offset computed by a call to the
307 <link linkend="bar">bar</link> function (or re-computed by a call to
308 <link linkend="barhomogenize">barhomogenize</link>) and is used to perform a nice horizontal
309 bar representation. Note that this offset is also taken into account
310 for all the other <literal>polyline_style</literal>. The unit is expressed
316 <term>z_shift: </term>
318 <para>This field contains the offset the user may specify. Note that
319 this offset is taken into account for all the
320 <literal>polyline_style</literal>. The unit is expressed in user
326 <term>bar_width: </term>
328 <para>This field determines the width of the selected polyline when its
329 <literal>polyline_style</literal> is set to bar mode (case 6) : the unit is
330 expressed in user coordinates.
335 <term>clip_state: </term>
338 This field contains the <literal>clip_state</literal> property value for
339 the polyline. It should be :
344 <literal>"off"</literal> this means that the polyline is not
350 <literal>"clipgrf"</literal> this means that the polyline is clipped
351 outside the Axes box.
356 <literal>"on"</literal> this means that the polyline is clipped
357 outside the rectangle given by property clip_box.
364 <term>clip_box: </term>
367 This field is to determinate the <literal>clip_box</literal> property.
368 By Default its value should be an empty matrix if clip_state is "off".
369 Other cases the vector <literal>[x,y,w,h]</literal> (upper-left point width
370 height) defines the portions of the polyline to display, however
371 <literal>clip_state</literal> property value will be changed.
376 <term>user_data: </term>
378 <para>This field can be use to store any scilab variable in the polyline
379 data structure, and to retrieve it.
386 <title>Sample</title>
388 a=get("current_axes")
389 a.data_bounds=[-2,-2;2,2];
391 xpoly(sin(2*%pi*(0:5)/5),cos(2*%pi*(0:5)/5),"lines",0)
396 d=p.data;d(1,:)=[0 0];p.data=d;
397 a.rotation_angles=[0 45];
401 <title>Examples</title>
402 <programlisting role="example"><![CDATA[
403 a=get("current_axes")//get the handle of the newly created axes
404 a.data_bounds=[-2,-2;2,2];
406 xpoly(sin(2*%pi*(0:5)/5),cos(2*%pi*(0:5)/5),"lines",0)
407 p=get("hdl"); //get handle on current entity (here the polyline entity)
411 d=p.data;d(1,:)=[0 0];p.data=d;
412 a.rotation_angles=[0 45];
414 p.data=[(-2:0.1:2)' sin((-2:0.1:2)*%pi)']
420 <refsection role="see also">
421 <title>See Also</title>
422 <simplelist type="inline">
424 <link linkend="set">set</link>
427 <link linkend="get">get</link>
430 <link linkend="delete">delete</link>
433 <link linkend="xpoly">xpoly</link>
436 <link linkend="xfpoly">xfpoly</link>
439 <link linkend="xpolys">xpolys</link>
442 <link linkend="xfpolys">xfpolys</link>
445 <link linkend="graphics_entities">graphics_entities</link>
450 <title>History</title>
453 <revnumber>5.4.0</revnumber>
454 <revremark>line_style value 0 is obsolete, use 1 instead (both are equivalent for SOLID). Using value 0 will produce an error in Scilab 5.4.1.</revremark>