# HG changeset patch # User Ben Abbott # Date 1271109805 14400 # Node ID 62ebba45054e27eb75e967371ccd4db20b65845d # Parent ddbd812d09aafdd7839ccebe7d710cd94ad54469 Respect the nextplot property value of 'new' for axes and 'replacechildren' for axes and figures. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2010-04-12 Ben Abbott + + * plot/__plt_get_axis_arg__.m, plot/newplot.m: Respect the nextplot + property value of 'new' for axes and 'replacechildren' for axes and + figures. + 2010-04-10 Ben Abbott * plot/__go_draw_figure__.m: Don't set background for non-visible axes. diff --git a/scripts/plot/__plt_get_axis_arg__.m b/scripts/plot/__plt_get_axis_arg__.m --- a/scripts/plot/__plt_get_axis_arg__.m +++ b/scripts/plot/__plt_get_axis_arg__.m @@ -68,6 +68,10 @@ endif endif + if (ishandle (h) && strcmp (get (h, "nextplot"), "new")) + h = axes (); + endif + narg = length (varargin); endfunction diff --git a/scripts/plot/newplot.m b/scripts/plot/newplot.m --- a/scripts/plot/newplot.m +++ b/scripts/plot/newplot.m @@ -36,6 +36,7 @@ case "new" case "add" case "replacechildren" + delete (get (cf, "children")) case "replace" otherwise error ("newplot: unrecognized nextplot property for current figure"); @@ -43,8 +44,10 @@ ca = gca (); anp = get (ca, "nextplot"); switch (anp) + case "new" case "add" case "replacechildren" + delete (get (ca, "children")) case "replace" __go_axes_init__ (ca, "replace"); __request_drawnow__ ();