figure_properties updates after recent changes.
[scilab.git] / scilab / modules / graphics / help / en_US / figure_operations / figure_properties.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 - Djalel Abdemouche
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="figure_properties">
14     <refnamediv>
15         <refname>figure properties</refname>
16         <refpurpose>description of the graphics
17             figure entity properties
18         </refpurpose>
19     </refnamediv>
20     <refsection>
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.
27         </para>
28         <variablelist>
29             <varlistentry>
30                 <term>Figure properties: </term>
31                 <listitem>
32                     <variablelist>
33                         <varlistentry>
34                             <term>children: </term>
35                             <listitem>
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.
41                                 </para>
42                             </listitem>
43                         </varlistentry>
44                         <varlistentry>
45                             <term>figure_style: </term>
46                             <listitem>
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.
50                                 </para>
51                             </listitem>
52                         </varlistentry>
53                         <varlistentry>
54                             <term>figure_position: </term>
55                             <listitem>
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
60                                     screen.
61                                 </para>
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.
66                                 </para>
67                             </listitem>
68                         </varlistentry>
69                         <varlistentry>
70                             <term>figure_size: </term>
71                             <listitem>
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>.
75                                 </para>
76                             </listitem>
77                         </varlistentry>
78                         <varlistentry>
79                             <term>axes_size: </term>
80                             <listitem>
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
85                                     with other elements.
86                                 </para>
87                             </listitem>
88                         </varlistentry>
89                         <varlistentry>
90                             <term>auto_resize: </term>
91                             <listitem>
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.
98                                 </para>
99                             </listitem>
100                         </varlistentry>
101                         <varlistentry>
102                             <term>viewport: </term>
103                             <listitem>
104                                 <para>Postion of the visible part of graphics in the
105                                     panner.
106                                 </para>
107                             </listitem>
108                         </varlistentry>
109                         <varlistentry>
110                             <term>figure_name: </term>
111                             <listitem>
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.
117                                 </para>
118                             </listitem>
119                         </varlistentry>
120                         <varlistentry>
121                             <term>figure_id: </term>
122                             <listitem>
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
125                                     changed after.
126                                 </para>
127                             </listitem>
128                         </varlistentry>
129                         <varlistentry>
130                             <term>info_message: </term>
131                             <listitem>
132                                 <para>This character string set the text displayed in the info bar of the
133                                     graphic window.
134                                 </para>
135                             </listitem>
136                         </varlistentry>
137                         <varlistentry>
138                             <term>color_map: </term>
139                             <listitem>
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
145                                     between 0 and 1.
146                                 </para>
147                             </listitem>
148                         </varlistentry>
149                         <varlistentry>
150                             <term>pixel_drawing_mode: </term>
151                             <listitem>
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>.
155                                 </para>
156                             </listitem>
157                         </varlistentry>
158                         <varlistentry>
159                             <term>anti_aliasing: </term>
160                             <listitem>
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.
166                                 </para>
167                             </listitem>
168                         </varlistentry>
169                         <varlistentry>
170                             <term>immediate_drawing: </term>
171                             <listitem>
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>).
180                                 </para>
181                             </listitem>
182                         </varlistentry>
183                         <varlistentry>
184                             <term>background: </term>
185                             <listitem>
186                                 <para>This property controls the figure window background color. It
187                                     takes as value an index relative to the current colormap.
188                                 </para>
189                             </listitem>
190                         </varlistentry>
191                         <varlistentry>
192                             <term>event_handler</term>
193                             <listitem>
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.
198                                 </para>
199                             </listitem>
200                         </varlistentry>
201                         <varlistentry>
202                             <term>event_handler_enable</term>
203                             <listitem>
204                                 <para>Enable or disable the event handler. Its value must be either
205                                     "on" or "off".
206                                 </para>
207                             </listitem>
208                         </varlistentry>
209                         <varlistentry>
210                             <term>user_data: </term>
211                             <listitem>
212                                 <para>This field can be use to store any scilab variable in the
213                                     figure data structure, and to retreive it.
214                                 </para>
215                             </listitem>
216                         </varlistentry>
217                         <varlistentry>
218                             <term>tag: </term>
219                             <listitem>
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>
221                             </listitem>
222                         </varlistentry>
223                         <varlistentry>
224                             <term>resizefcn: </term>
225                             <listitem>
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>
227                             </listitem>
228                         </varlistentry>
229                         <varlistentry>
230                             <term>closerequestfcn: </term>
231                             <listitem>
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>
234                             </listitem>
235                         </varlistentry>
236                         <varlistentry>
237                             <term>resize: </term>
238                             <listitem>
239                                 <para>
240                                     This property locks the figure size. Its value can be <literal>"on"</literal> (default value) or <literal>"off"</literal> (the figure can not be resized neither through <link linkend="set">set</link> nor mouse events).
241                                 </para>
242                             </listitem>
243                         </varlistentry>
244                         <varlistentry>
245                             <term>menubar_visible: </term>
246                             <listitem>
247                                 <para>
248                                     This property controls the figure menubar visibility. Its value can be <literal>"on"</literal> (default value) or <literal>"off"</literal>.
249                                 </para>
250                             </listitem>
251                         </varlistentry>
252                         <varlistentry>
253                             <term>toolbar_visible: </term>
254                             <listitem>
255                                 <para>
256                                     This property controls the figure toolbar visibility. Its value can be <literal>"on"</literal> (default value) or <literal>"off"</literal>.
257                                 </para>
258                             </listitem>
259                         </varlistentry>
260                         <varlistentry>
261                             <term>infobar_visible: </term>
262                             <listitem>
263                                 <para>
264                                     This property controls the figure status bar visibility. Its value can be <literal>"on"</literal> (default value) or <literal>"off"</literal>.
265                                 </para>
266                             </listitem>
267                         </varlistentry>
268                         <varlistentry>
269                             <term>visible: </term>
270                             <listitem>
271                                 <para>
272                                     When the figure <literal>"dockable"</literal> property is <literal>"off"</literal>, setting the <literal>"Visible"</literal> property affects the whole figure including its window decorations.
273                                 </para>
274                                 <para>
275                                     When the figure <literal>"dockable"</literal> property is <literal>"on"</literal> and the figure is docked with an other one inside the same parent window, this field concerns only the figure children (See dedicated part below). If the figure is not docked with an other one, then the <literal>"Visible"</literal> property behaves as if the figure <literal>"dockable"</literal> property was set to <literal>"off"</literal>.
276                                 </para>
277                             </listitem>
278                         </varlistentry>
279                         <varlistentry>
280                             <term>layout: </term>
281                             <listitem>
282                                 <para>
283                                     This property sets the layout used to dispose the figure children. See <link linked="layouts">layouts</link> page for more information about available layouts.
284                                 </para>
285                             </listitem>
286                         </varlistentry>
287                         <varlistentry>
288                             <term>layout_options: </term>
289                             <listitem>
290                                 <para>
291                                     This property sets the options of the layout used to dispose the figure children. See <link linked="layout">layouts</link> page for more information about available options.
292                                 </para>
293                             </listitem>
294                         </varlistentry>
295                         <varlistentry>
296                             <term>icon: </term>
297                             <listitem>
298                                 <para>This field can be used to customize the icon of a Scilab figure.</para>
299                                 <para>
300                                     Its value is a character string containing the (absolute or relaitve to Scilab <link linkend="pwd">current working directory.</link> path of the image file containing the icon.
301                                 </para>
302                             </listitem>
303                         </varlistentry>
304                         <varlistentry>
305                             <term>default_axes: </term>
306                             <listitem>
307                                 <para>
308                                     This property enables to manage axes creation in figures. Its value can be <literal>"on"</literal> (default value) or <literal>"off"</literal>.
309                                 </para>
310                                 <para>
311                                     If its value is <literal>"on"</literal>, an axes will be created at figure creation and each time the latest axes of the figure is deleted, a new one will be created. If its value is <literal>"off"</literal>, no axes will be initialized at figure creation but an axes can be added in the figure using <link linkend="newaxes">newaxes</link> function.
312                                 </para>
313                             </listitem>
314                         </varlistentry>
315                     </variablelist>
316                 </listitem>
317             </varlistentry>
318         </variablelist>
319         <variablelist>
320             <varlistentry>
321                 <term>Children's default values: </term>
322                 <listitem>
323                     <variablelist>
324                         <varlistentry>
325                             <term>visible: </term>
326                             <para>{"on"} | "off"</para>
327                             <listitem>
328                                 <para>This field sets if the contents of the figure (axes and uicontrols) has to be
329                                     redrawn. Its value should be <literal>"on"</literal> or <literal>"off"</literal>.
330                                 </para>
331                             </listitem>
332                         </varlistentry>
333                         <varlistentry>
334                             <term>rotation_style: </term>
335                             <para>{"unary"} | "multiple"</para>
336                             <listitem>
337                                 <para>This field is related to the "3D Rot" button. It takes
338                                     <literal>unary</literal> as value (default) in the aim to rotate only
339                                     selected 3D plot. In the other case its value can be
340                                     <literal>multiple</literal> : all 3D plots are rotated.
341                                 </para>
342                             </listitem>
343                         </varlistentry>
344                     </variablelist>
345                 </listitem>
346             </varlistentry>
347         </variablelist>
348         <variablelist>
349             <varlistentry>
350                 <term>Creation related properties: </term>
351                 <para>
352                     Some properties must be set at creation time using the <link linkend="figure">figure</link> function and will be then read-only.
353                 </para>
354                 <listitem>
355                     <variablelist>
356                         <varlistentry>
357                             <term>dockable</term>
358                             <listitem>
359                                 <para>
360                                     This property determines if created window can be docked inside Scilab environnment. If its value is <literal>"on"</literal> then the window will have a bar enabling the user to dock/undock it. Else the window will look like a standard OS window. This value can only be set at creation.
361                                 </para>
362                             </listitem>
363                         </varlistentry>
364                         <varlistentry>
365                             <term>menubar</term>
366                             <listitem>
367                                 <para>{"figure"} | "none"</para>
368                                 <para>
369                                     This property determines the type of the menubar of the figure. If its value is <literal>"none"</literal> then the window will not have any menubar until a menu is added using <link linkend="uimenu">uimenu function</link>. Else the window will be created with default figure menus. This value can only be set at creation.
370                                 </para>
371                             </listitem>
372                         </varlistentry>
373                         <varlistentry>
374                             <term>toolbar</term>
375                             <listitem>
376                                 <para>{"figure"} | "none"</para>
377                                 <para>
378                                     This property determines the type of the toolbar of the figure. If its value is <literal>"none"</literal> then the window will not have any menubar. Else the window will be created with a default figure toolbar. This value can only be set at creation.
379                                 </para>
380                             </listitem>
381                         </varlistentry>
382                     </variablelist>
383                 </listitem>
384             </varlistentry>
385             <varlistentry>
386                 <term>Note on default values: </term>
387                 <listitem>
388                     <variablelist>
389                         <varlistentry>
390                             <term/>
391                             <listitem>
392                                 <para>All these listed properties and fields inherit from default
393                                     values stored in a figure model. These default values can be seen
394                                     and changed. To do so, use the <literal>get("default_figure")</literal>
395                                     command : it returns a graphic handle on the figure model. Note
396                                     that no graphic window is created by this command. The next
397                                     created figures will inherit from this model (see example 2
398                                     below).
399                                 </para>
400                             </listitem>
401                         </varlistentry>
402                     </variablelist>
403                 </listitem>
404             </varlistentry>
405         </variablelist>
406     </refsection>
407     <refsection>
408         <title>Examples</title>
409         <programlisting role="example">
410             <![CDATA[
411 lines(0) // disables vertical paging
412
413 //Example 1
414 f=get("current_figure") //get the handle of the current figure :
415                         //if none exists, create a figure and return the corresponding handle
416 f.figure_position
417 f.figure_size=[200,200]
418 f.background=2
419 f.children  // man can see that an Axes entity already exists
420 delete(f);
421 f=gcf(); // macro shortcut <=> f=get("current_figure")
422 f.immediate_drawing = "off";
423 plot2d() // nothing happens on the screen...
424 f.immediate_drawing = "on";
425
426 //Example 2 : default_figure settings
427 df=get("default_figure") // get the default values (shortcut is gdf() )
428 // Let's change the defaults...
429 df.color_map=hotcolormap(128)
430 df.background= 110 // set background toa kind of yellow (Note that we
431                    // are using a color index inside the color_map previously redefined)
432 scf(122); // creates new figure number 122 with the new default
433 plot2d()
434 scf(214);
435 t=-%pi:0.3:%pi;
436 plot3d(t,t,sin(t)'*cos(t),35,45,'X@Y@Z',[15,2,4]);
437  ]]>
438         </programlisting>
439     </refsection>
440     <refsection role="see also">
441         <title>See Also</title>
442         <simplelist type="inline">
443             <member>
444                 <link linkend="lines">lines</link>
445             </member>
446             <member>
447                 <link linkend="set">set</link>
448             </member>
449             <member>
450                 <link linkend="get">get</link>
451             </member>
452             <member>
453                 <link linkend="scf">scf</link>
454             </member>
455             <member>
456                 <link linkend="gcf">gcf</link>
457             </member>
458             <member>
459                 <link linkend="gdf">gdf</link>
460             </member>
461             <member>
462                 <link linkend="gca">gca</link>
463             </member>
464             <member>
465                 <link linkend="gda">gda</link>
466             </member>
467             <member>
468                 <link linkend="axes_properties">axes_properties</link>
469             </member>
470             <member/>
471             <member>
472                 <link linkend="hotcolormap">hotcolormap</link>
473             </member>
474             <member>
475                 <link linkend="eventhandlerfunctions">event handler functions</link>
476             </member>
477         </simplelist>
478     </refsection>
479     <refsection>
480         <title>History</title>
481         <revhistory>
482             <revision>
483                 <revnumber>5.5.0</revnumber>
484                 <revremark>"visible" property meaning changed (uicontrols managed and the whole figure can be made invisible in some cases.</revremark>
485                 <revremark>"icon" property added to allow figure icon change.</revremark>
486                 <revremark>"menubar_visible" property added.</revremark>
487                 <revremark>"toolbar_visible" property added.</revremark>
488                 <revremark>"infobar_visible" property added.</revremark>
489                 <revremark>"resize" property added.</revremark>
490                 <revremark>"dockable" property added.</revremark>
491                 <revremark>"menubar" property added.</revremark>
492                 <revremark>"toolbar" property added.</revremark>
493                 <revremark>"default_axes" property added.</revremark>
494                 <revremark>"layout" property added.</revremark>
495                 <revremark>"layout_options" property added.</revremark>
496             </revision>
497             <revision>
498                 <revnumber>5.4.0</revnumber>
499                 <revremark>New resizefcn &amp; closerequestfcn properties introduced.</revremark>
500             </revision>
501         </revhistory>
502     </refsection>
503 </refentry>