2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) INRIA - Serge Steer
4 * Copyright (C) INRIA - Jean-Baptiste Silvy
5 * Copyright (C) Samuel GOUGEON : update after fix of bug 7411
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
14 <refentry xml:lang="en" xml:id="clf">
16 <refname>clf</refname>
18 Clear or reset or reset a figure or a frame uicontrol.
22 <title>Calling Sequence</title>
26 clf(figureHandle[, opt_job_arg])
27 clf(num[, opt_job_arg])
29 clf(frameHandle[, opt_job_arg)
33 <title>Arguments</title>
36 <term>figureHandle</term>
38 <para>A handle: the handle of the figure to clear or reset.</para>
44 <para>An integer value: the figure_id of the figure to clear or reset.</para>
48 <term>frameHandle</term>
50 <para>A handle: the handle of the frame to clear or reset.</para>
54 <term>opt_job_arg</term>
57 A string which specifying the job for <function>clf</function>.
58 Its value can be <literal>"clear"</literal> (default) or <literal>"reset"</literal>.
65 <title>Description</title>
67 The <literal>clf</literal> command can be used to reset a figure to its default
68 values and/or to delete all its children. If can also be used to delete all the children of a frame.
72 <term>First input argument: </term>
79 <literal>clf(num,..)</literal> clears or resets the figure with <literal>figure_id==num</literal>
84 <term>figureHandle</term>
87 <literal>clf(figureHandle,..)</literal> clears or resets the figure pointed to by the handle <literal>h</literal>
95 <literal>clf(job)</literal> clears or resets the current figure.
103 <term>Second input argument:</term>
107 <term>"clear" (default)</term>
110 <literal>clf(.., "clear")</literal> clears the targetted figure or frame.
113 All its <literal>children</literal> are deleted: axes, uicontrols, menus (for figures only), ...
114 To prevent menus and uicontrols from being deleted from a figure, the <literal>delete(gca())</literal> command
115 might be used instead.
118 Its event handler is disabled: <literal>.event_handler_enable = "off"</literal>
121 The message in the status bar is cleared: <literal>.info_message = ""</literal>
124 All other figure's properties are unchanged.
132 Used for figures only, <literal>clf(.., "reset")</literal> deletes all children of the specified figure. In addition, all figure's
133 properties are reset to their default values as returned by <link linkend="gdf">gdf</link>. The only exception are the
134 <literal>axes_size</literal>
135 and <literal>figure_size</literal> properties, which can not be reset if the figure
136 is docked with other elements.
146 <title>Examples</title>
147 <programlisting role="example">
148 f4=scf(4); //creates figure with id==4 and make it the current one
149 f4.color_map = jetcolormap(64);
150 f4.figure_size = [400, 200];
154 f0=scf(0); //creates figure with id==0 and make it the current one
155 f0.color_map = hotcolormap(128); // change color map
157 plot3d1(t,t,sin(t)'*cos(t));
159 clf() // equivalent to clf(gcf(),"clear")
160 plot3d1(t,t,sin(t)'*cos(t)); // color_map unchanged
163 plot3d1(t,t,sin(t)'*cos(t)); // color_map changed (back to the default one with 32 colors)
165 fr = uicontrol("Style", "frame", "Position", [20 20 200 200]);
171 <refsection role="see also">
172 <title>See Also</title>
173 <simplelist type="inline">
175 <link linkend="figure_properties">figure properties</link>
178 <link linkend="gcf">gcf</link>
181 <link linkend="gdf">gdf</link>
184 <link linkend="scf">scf</link>
187 <link linkend="set">set</link>
190 <link linkend="get">get</link>
193 <link linkend="graphics_entities">graphics_entities</link>
198 <title>History</title>
201 <revnumber>5.5.0</revnumber>
203 <function>clf</function> works for all axes parents (figures and frames).