Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Graphiques > figure_operations > clf


clear or reset the current graphic figure (window) to default values

Calling Sequence




a handle, the figure handle


a number, the figure_id


a string ( 'clear'or 'reset' ) specifying the job for clf.


The clf command is used to reset a figure to its default values and/or to delete all its children.

If opt_job_arg string value is 'clear' then all children of the specified figure are deleted.

If opt_job_arg string value is 'reset' then not only all children of the specified figure are deleted but the figure properties are reset to their default values using the default figure model (see gdf). The only exception are the axes_size and figure_size properties which can not be reset if the figure is docked with other elements.

clf(num) clear or reset the figure with figure_id==num.

clf(h) clear or reset the figure pointed to by the handle h.

clf() clear or reset the current figure.

clf function delete every children of specified windows including menus and uicontrols added by user. To prevent menus and uicontrols from being deleted, the delete(gca()) command might be used instead.


f4=scf(4);  //creates figure with id==4 and make it the current one
f4.color_map = jetcolormap(64);
f4.figure_size = [400, 200];
f0=scf(0); //creates figure with id==0 and make it the current one
f0.color_map=hotcolormap(128); // change color map

clf() // equivalent to clf(gcf(),'clear')
plot3d1(t,t,sin(t)'*cos(t));  // color_map unchanged
plot3d1(t,t,sin(t)'*cos(t));  // color_map changed (back to the default one with 32 colors)

See Also

  • set — set a property value of a graphic entity object or of a User Interface object.
  • get — Retrieve a property value from a graphics entity or an User Interface object.
  • gcf — Return handle of current graphic window.
  • gdf — Return handle of default figure.
  • scf — set the current graphic figure (window)
  • graphics_entities — description of the graphics entities data structures
Report an issue
<< figure_operations figure_operations drawlater >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:37:26 CEST 2012