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.1-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" xml:lang="en" xml:id="figure_properties">
15 <refname>figure properties</refname>
16 <refpurpose>description of the graphics
17 figure entity properties
21 <title>Description</title>
22 <para>The figure entity is the top level of the graphics entities hierarchy.
23 This entity contain a number of properties designed to control many
24 aspects of displaying Scilab graphics objects. These properties fall into
25 two categories. Properties that contain information about figure itself
26 and others related to set default values for the children creation.
30 <term>Figure properties: </term>
34 <term>children: </term>
36 <para>This handles represent the vector of the figure's children .
37 Note that all figure children are of type <literal>"Axes"</literal>.
38 Also keep in mind that, when creating a figure entity (using
39 <link linkend="scf">scf</link> command), an <literal>Axes</literal> entity is
40 simultaneously built too.
45 <term>figure_style: </term>
47 <para>The value of this field defines the figure style.
48 Since Scilab 5.0, old graphic mode has been disable.
49 This property will be removed in Scilab 5.4 family.
54 <term>figure_position: </term>
56 <para>This field contains the position in pixel of the graphic
57 window on the screen. This is a vector <literal>[x,y]</literal>
58 defining the position of the upper-left corner of the window.
59 The position <literal>[0,0]</literal> is the upper-left corner of the
62 <para>The initial position of graphic windows is taken from the default figure entity (see
63 <link linkend="gdf">gdf</link>). The only exception is when default figure <literal>figure_position</literal>
64 value is <literal>[-1,-1]</literal>. In this case, the initial position of graphic windows is automatically set
65 by the windowing system.
70 <term>figure_size: </term>
72 <para>This property controls the size in pixel of the screen's
73 graphics window. The size is the vector
74 <literal>[width,height]</literal>.
79 <term>axes_size: </term>
81 <para>Used to Specifies the size in pixel of the virtual graphics
82 window. The size is the vector <literal>[width,height] </literal>. The
83 virtual graphic window should be bigger than the part really
84 visible on the screen. This property could not be modified if the figure is docked
90 <term>auto_resize: </term>
92 <para>This property determines if graphics window is resized. If the
93 value is <literal>"on"</literal> then the <literal>axes_size</literal>
94 property is equaled to the <literal>figure_size</literal> and the axes
95 children are zoomed accordingly. If the value is
96 <literal>"off"</literal> that indicate that <literal>axes_size</literal>
97 cannot be resized when <literal>figure_size</literal> is changed.
102 <term>viewport: </term>
104 <para>Postion of the visible part of graphics in the
110 <term>figure_name: </term>
112 <para>This field contains the name of the figure. This name is a
113 character string displayed at the top of the graphics_window. The
114 name can contain a single substring <literal>%d</literal> which will be
115 replaced by the <literal>figure_id</literal>. No other instance of the
116 <literal>%</literal> character is allowed inside the name.
121 <term>figure_id: </term>
123 <para>This field contains the identifier of the figure. This is an
124 integer number which is set at figure creation and cannot be
130 <term>info_message: </term>
132 <para>This character string set the text displayed in the info bar of the
138 <term>color_map: </term>
140 <para>Property which defines the colormap used by this figure. The
141 colormap is a <literal>m</literal> by <literal>3</literal> matrix.
142 <literal>m</literal> is the number of colors. Color number i is given as
143 a 3-uple <literal>R</literal>, <literal>G</literal>, <literal>B</literal>
144 corresponding respectively to red, green and blue intensity
150 <term>pixel_drawing_mode: </term>
152 <para>This field specifies the bitwise operation used for pixel rendering.
153 The default mode is <literal>copy</literal>.
154 For more details see the <link linkend="pixel_drawing_mode">pixel drawing mode reference page</link>.
159 <term>anti_aliasing: </term>
161 <para>This property controls the anti-aliasing level used to improve graphic quality.
162 If the property is set to "off", anti-aliasing is disable. To enable anti-aliasing
163 the property must set to either "2x", "4x", "8x" or "16x". In this case, it stands for the anti-aliasing level.
164 For example, "16x" is a higher quality level than "2x".
165 Specifying a higher anti-aliasing level improves image quality but also decreases graphic performances.
170 <term>immediate_drawing: </term>
172 <para>This property controls the figure display. Its value can be
173 <literal>"on"</literal> (default mode) or <literal>"off"</literal>. It is used
174 to delay a huge succession of graphics commands (implying several
175 drawings or redrawings). Note that, when using
176 <literal>drawlater</literal> or <literal>drawnow</literal> commands, it
177 affects the property value of the current figure (which is
178 respectively turned to <literal>'off'</literal> or
179 <literal>'on'</literal>).
184 <term>background: </term>
186 <para>This property controls the figure window background color. It
187 takes as value an index relative to the current colormap.
192 <term>event_handler</term>
194 <para>A character string. The name of the Scilab function which is intended
195 to handle the events. Note that setting an empty string will disable
196 the event handler. For more information about event handler functions see the
197 <link linkend="eventhandlerfunctions">event handler functions</link> help.
202 <term>event_handler_enable</term>
204 <para>Enable or disable the event handler. Its value must be either
210 <term>user_data: </term>
212 <para>This field can be use to store any scilab variable in the
213 figure data structure, and to retreive it.
220 <para>This field can be use to store a character string generally used to identify the control. It allows to give it a "name". Mainly used in conjontion with findobj().</para>
224 <term>resizefcn: </term>
226 <para>This field can be used to store the name of a Scilab function or a Scilab expression as a character string. This character string will be evaluated whenever the user resizes the figure and when the figure is created. </para>
230 <term>closerequestfcn: </term>
232 <para>This field can be used to store the name of a Scilab function or a Scilab expression as a character string. This character string will be evaluated whenever the user tries to close the figure using the top-right cross.</para>
233 <para>When this property is set, the "figure closed" event (-1000) will no more be trapped by the event handler function.</para>
242 <term>Children's default values: </term>
246 <term>visible: </term>
248 <para>This field sets if the contents of the figure (axes and uicontrols) has to be
249 redrawn. Its value should be <literal>"on"</literal> or
250 <literal>"off"</literal>.
255 <term>rotation_style: </term>
257 <para>This field is related to the "3D Rot" button. It takes
258 <literal>unary</literal> as value (default) in the aim to rotate only
259 selected 3D plot. In the other case its value can be
260 <literal>multiple</literal> : all 3D plots are rotated.
268 <term>Note on default values :</term>
274 <para>All these listed properties and fields inherit from default
275 values stored in a figure model. These default values can be seen
276 and changed. To do so, use the <literal>get("default_figure")</literal>
277 command : it returns a graphic handle on the figure model. Note
278 that no graphic window is created by this command. The next
279 created figures will inherit from this model (see example 2
290 <title>Examples</title>
291 <programlisting role="example">
293 lines(0) // disables vertical paging
296 f=get("current_figure") //get the handle of the current figure :
297 //if none exists, create a figure and return the corresponding handle
299 f.figure_size=[200,200]
301 f.children // man can see that an Axes entity already exists
303 f=gcf(); // macro shortcut <=> f=get("current_figure")
304 f.immediate_drawing = "off";
305 plot2d() // nothing happens on the screen...
306 f.immediate_drawing = "on";
308 //Example 2 : default_figure settings
309 df=get("default_figure") // get the default values (shortcut is gdf() )
310 // Let's change the defaults...
311 df.color_map=hotcolormap(128)
312 df.background= 110 // set background toa kind of yellow (Note that we
313 // are using a color index inside the color_map previously redefined)
314 scf(122); // creates new figure number 122 with the new default
318 plot3d(t,t,sin(t)'*cos(t),35,45,'X@Y@Z',[15,2,4]);
322 <refsection role="see also">
323 <title>See Also</title>
324 <simplelist type="inline">
326 <link linkend="lines">lines</link>
329 <link linkend="set">set</link>
332 <link linkend="get">get</link>
335 <link linkend="scf">scf</link>
338 <link linkend="gcf">gcf</link>
341 <link linkend="gdf">gdf</link>
344 <link linkend="gca">gca</link>
347 <link linkend="gda">gda</link>
350 <link linkend="axes_properties">axes_properties</link>
354 <link linkend="hotcolormap">hotcolormap</link>
357 <link linkend="eventhandlerfunctions">event handler functions</link>
362 <title>History</title>
365 <revnumber>5.5.0</revnumber>
366 <revremark>"visible" property also applies to uicontrols.</revremark>
369 <revnumber>5.4.0</revnumber>
370 <revremark>New resizefcn & closerequestfcn properties introduced.</revremark>