Create a chapter for borders help pages
[scilab.git] / scilab / modules / graphics / help / en_US / property / set.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="set">
14     <refnamediv>
15         <refname>set</refname>
16         <refpurpose>set a property value of a graphic entity
17             object or of a User Interface object.
18         </refpurpose>
19     </refnamediv>
20     <refsynopsisdiv>
21         <title>Calling Sequence</title>
22         <synopsis>set(prop,val)
23             set(h,prop)
24             set(h,prop,val)
25             h.prop=val
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>h</term>
33                 <listitem>
34                     <para>graphic handle of the entity which to set the named
35                         property. <literal>h</literal> can be a vector of handles, in which case
36                         set modifies the property for all entities contained in h.
37                     </para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>prop</term>
42                 <listitem>
43                     <para>character string, name of the property to set.</para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>val</term>
48                 <listitem>
49                     <para>value to give to the property.</para>
50                 </listitem>
51             </varlistentry>
52         </variablelist>
53     </refsection>
54     <refsection>
55         <title>Description</title>
56         <para>This routine can be used to modify the value of a specified property from a
57             graphics entity or a GUI object. In this case it is equivalent to use the dot operator on a handle.
58             For exemple, <literal>set(h,"background",5)</literal> is equivalent to <literal>h.background = 5</literal>.
59         </para>
60         <para>Property names are character strings. The type of the set values depends on the handle type and property.
61         </para>
62         <para>To get the list of all existing properties
63             see <link linkend="graphics_entities">graphics_entities</link> or <link linkend="uicontrol">uicontrol</link>
64             for User Interface objects.
65         </para>
66         <para>
67             <literal>set</literal> function can be also called with only a property and a value as argument. In this case,
68             the property must be one of the following:
69         </para>
70         <variablelist>
71             <varlistentry>
72                 <term>current_entity or hdl</term>
73                 <listitem>
74                     <para>
75                         <literal>set('current_entity',h)</literal> or <literal>set('hdl',h)</literal> sets a new entity as current.
76                         In this case, the value must be a graphic handle.
77                     </para>
78                 </listitem>
79             </varlistentry>
80             <varlistentry>
81                 <term>current_figure</term>
82                 <listitem>
83                     <para>
84                         <literal>set('current_figure',fig)</literal> sets a new graphic figure as current.
85                         It is equivalent to <link linkend="scf">scf</link>. In this case, the value must be a Figure handle.
86                     </para>
87                 </listitem>
88             </varlistentry>
89             <varlistentry>
90                 <term>current_axes</term>
91                 <listitem>
92                     <para>
93                         <literal>set('current_axes',axes)</literal> sets a new axes entity as current.
94                         It is equivalent to <link linkend="sca">sca</link>. In this case, the value must be an Axes handle.
95                     </para>
96                 </listitem>
97             </varlistentry>
98         </variablelist>
99         <para>
100             <literal>set</literal> can also be called with a graphic handle and property as arguments.
101             The handle must be either a handle on the default figure or the default axes entities.
102             The property must be <literal>"default_values"</literal>. In this case, the default entity
103             is reset to the value it had at Scilab startup. <literal>set("default_values",h)</literal>
104             is equivalent to <link linkend="sda">sda</link> or <link linkend="sdf">sdf</link>.
105         </para>
106     </refsection>
107     <refsection>
108         <title>Examples</title>
109         <programlisting role="example"><![CDATA[ 
110 clf()
111 set("auto_clear","off") ;
112 // Exemple of a Plot 2D
113 x=[-.2:0.1:2*%pi]';
114 plot2d(x-.3,[sin(x-1) cos(2*x)],[1 2] );
115 a=get("current_axes");
116 p1=a.children.children(1);
117 p2=a.children.children(2);
118 // set the named properties to the specified values on the objects
119 set(p2,"foreground",13);
120 set(p2,"polyline_style",2);
121 set(a,'tight_limits',"on");
122 set(a,"box","off");
123 set(a,"sub_tics",[ 7 0 ]);
124 set(a,"y_location","middle")
125 set(p2,'thickness',2);
126 set(p1,'mark_mode',"on");
127 set(p1,'mark_style',3);
128 plot2d(x-2,x.^2/20);
129 p3= a.children(1).children;
130 set([a p1 p2 p3],"foreground",5)
131  ]]></programlisting>
132     </refsection>
133     <refsection role="see also">
134         <title>See Also</title>
135         <simplelist type="inline">
136             <member>
137                 <link linkend="get">get</link>
138             </member>
139             <member>
140                 <link linkend="delete">delete</link>
141             </member>
142             <member>
143                 <link linkend="copy">copy</link>
144             </member>
145             <member>
146                 <link linkend="move">move</link>
147             </member>
148             <member>
149                 <link linkend="graphics_entities">graphics_entities</link>
150             </member>
151             <member>
152                 <link linkend="uicontrol">uicontrol</link>
153             </member>
154         </simplelist>
155     </refsection>
156 </refentry>