From: Vincent COUVERT Date: Wed, 12 Mar 2014 14:22:34 +0000 (+0100) Subject: * clf function now also works with "frame" uicontrols. X-Git-Tag: 5.5.0~370 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=a7d6cf4f4f91e5c371b88c81eb308630008ba943;hp=9cac973a265ebb853d7471c8e7305952b49c166c * clf function now also works with "frame" uicontrols. See https://codereview.scilab.org/#/c/13958/ Change-Id: Ic466e3cf2aeeee8916a378c70e90906d3784a415 --- diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X index 25dcc0f..3236d4f 100644 --- a/scilab/CHANGES_5.5.X +++ b/scilab/CHANGES_5.5.X @@ -92,6 +92,8 @@ Graphics Evolutions * newaxes function now allows to create axes in "frame" uicontrols. +* clf function now also works with "frame" uicontrols. + * New axes properties: - ticks_format: Format of the ticks labels. - ticks_st: Scales and translates factors applied to ticks position when formatting diff --git a/scilab/modules/graphics/help/en_US/figure_operations/clf.xml b/scilab/modules/graphics/help/en_US/figure_operations/clf.xml index 7671d35..501d4ad 100644 --- a/scilab/modules/graphics/help/en_US/figure_operations/clf.xml +++ b/scilab/modules/graphics/help/en_US/figure_operations/clf.xml @@ -3,50 +3,59 @@ * Copyright (C) INRIA - Serge Steer * Copyright (C) INRIA - Jean-Baptiste Silvy * Copyright (C) Samuel GOUGEON : update after fix of bug 7411 - * + * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at + * are also available at * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt * --> - + clf - clear or reset the current graphic figure (window) to default values + Clear or reset or reset a figure or a frame uicontrol. Calling Sequence - clf(<opt_job_arg>) - clf(h,<opt_job_arg>) - clf(num,<opt_job_arg>) + clf([opt_job_arg]) + + clf(figureHandle[, opt_job_arg]) + clf(num[, opt_job_arg]) + + clf(frameHandle[, opt_job_arg) Arguments - h + figureHandle - a handle, the figure handle + A handle: the handle of the figure to clear or reset. num - a number, the figure_id + An integer value: the figure_id of the figure to clear or reset. - <opt_job_arg> + frameHandle + + A handle: the handle of the frame to clear or reset. + + + + opt_job_arg - string 'clear' (default) or 'reset', - specifying the job for clf. + A string which specifying the job for clf. + Its value can be "clear" (default) or "reset". @@ -55,8 +64,8 @@ Description - The clf command is used to reset a figure to its default - values and/or to delete all its children. + The clf command can be used to reset a figure to its default + values and/or to delete all its children. If can also be used to delete all the children of a frame. @@ -72,82 +81,91 @@ - h + figureHandle - clf(h,..) clears or resets the figure pointed to by the handle h + clf(figureHandle,..) clears or resets the figure pointed to by the handle h - (none) + job - clf(..) clears or resets the current figure. - - - - - - - - opt_job_arg - - - - 'clear' (default) - - - clf(..,'clear') clears the targetted figure: - - all its children are deleted: axes, uicontrols, menus, and others. - To prevent menus and uicontrols from being deleted, the delete(gca()) command - might be used instead. - - Its event handler is disabled: .event_handler_enable = "off" - - The message in the status bar is cleared: .info_message = "" - - - All other figure's properties are unchanged. + clf(job) clears or resets the current figure. + + + + + Second input argument: + + - 'reset' + "clear" (default) - clf(..,'reset') deletes all children of the specified figure. In addition, all figure's - properties are reset to their default values as returned by 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.clears or resets the current figure. - - - - - - - - - - Examples - -f4=scf(4); //creates figure with id==4 and make it the current one -f4.color_map = jetcolormap(64); -f4.figure_size = [400, 200]; -plot2d() -clf(f4,'reset') - -f0=scf(0); //creates figure with id==0 and make it the current one -f0.color_map=hotcolormap(128); // change color map -t=-%pi:0.3:%pi; -plot3d1(t,t,sin(t)'*cos(t)); - -clf() // equivalent to clf(gcf(),'clear') -plot3d1(t,t,sin(t)'*cos(t)); // color_map unchanged - -clf(gcf(),'reset') -plot3d1(t,t,sin(t)'*cos(t)); // color_map changed (back to the default one with 32 colors) + + clf(.., "clear") clears the targetted figure or frame. + + + All its children are deleted: axes, uicontrols, menus (for figures only), ... + To prevent menus and uicontrols from being deleted from a figure, the delete(gca()) command + might be used instead. + + + Its event handler is disabled: .event_handler_enable = "off" + + + The message in the status bar is cleared: .info_message = "" + + + All other figure's properties are unchanged. + + + + + "reset" + + + Used for figures only, clf(.., "reset") deletes all children of the specified figure. In addition, all figure's + properties are reset to their default values as returned by 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. + + + + + + + + + + Examples + + f4=scf(4); //creates figure with id==4 and make it the current one + f4.color_map = jetcolormap(64); + f4.figure_size = [400, 200]; + plot2d() + clf(f4, "reset") + + f0=scf(0); //creates figure with id==0 and make it the current one + f0.color_map = hotcolormap(128); // change color map + t=-%pi:0.3:%pi; + plot3d1(t,t,sin(t)'*cos(t)); + + clf() // equivalent to clf(gcf(),"clear") + plot3d1(t,t,sin(t)'*cos(t)); // color_map unchanged + + clf(gcf(), "reset") + plot3d1(t,t,sin(t)'*cos(t)); // color_map changed (back to the default one with 32 colors) + + fr = uicontrol("Style", "frame", "Position", [20 20 200 200]); + a=newaxes(fr); + plot(1:10); + clf(fr); @@ -176,4 +194,15 @@ plot3d1(t,t,sin(t)'*cos(t)); // color_map changed (back to the default one with + + History + + + 5.5.0 + + clf works for all axes parents (figures and frames). + + + +