diff scripts/plot/util/newplot.m @ 19746:52cd69e79784

Fix legend function interaction with plotyy (bug #44246). * plotyy.m: Use addproperty correctly to add property, then set value. * newplot.m: Add special exception case when doing "replace" on an existing axis which is a plotyy axis. Instead of re-using existing axis and doing a "reset", delete the axis entirely and create a new one.
author Rik <rik@octave.org>
date Sat, 14 Feb 2015 07:12:22 -0800
parents 4197fc428c7d
children 9fc020886ae9
line wrap: on
line diff
--- a/scripts/plot/util/newplot.m	Fri Feb 13 20:51:59 2015 -0800
+++ b/scripts/plot/util/newplot.m	Sat Feb 14 07:12:22 2015 -0800
@@ -189,8 +189,15 @@
         kids(kids == hkid) = [];
         delete (kids);
       else
-        __go_axes_init__ (ca, "replace");
-        __request_drawnow__ ();
+        if (isprop (ca, "__plotyy_axes__"))
+          ## Hack for bug #44246.  There is no way to reset or remove a
+          ## property created with addproperty short of deleting the object.
+          delete (ca);
+          ca = axes ();
+        else
+          __go_axes_init__ (ca, "replace");
+          __request_drawnow__ ();
+        endif
       endif
       ## FIXME: The code above should perform the following:
       ###########################