changeset 6765:e6b528a3a2a9

[project @ 2007-06-28 15:25:43 by jwe]
author jwe
date Thu, 28 Jun 2007 15:25:44 +0000
parents 2a83fce5a097
children 6373d320a957
files scripts/ChangeLog scripts/plot/axis.m scripts/plot/subplot.m src/ChangeLog src/graphics.cc src/graphics.h
diffstat 6 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Jun 27 19:02:59 2007 +0000
+++ b/scripts/ChangeLog	Thu Jun 28 15:25:44 2007 +0000
@@ -1,3 +1,10 @@
+2007-06-28  Michael Goffioul  <michael.goffioul@gmail.com>
+
+	* plot/subplot.m: Add 'ishandle' check when parsing the existing axes.
+
+	* plot/axis.m: Also set "visible" property when setting axes to
+	on/off.
+
 2007-06-27  Michael Goffioul  <michael.goffioul@swing.be>
 
 	* image/colormap.m: Only return colormap if nargout > 0.
--- a/scripts/plot/axis.m	Wed Jun 27 19:02:59 2007 +0000
+++ b/scripts/plot/axis.m	Thu Jun 28 15:25:44 2007 +0000
@@ -178,8 +178,10 @@
       set (ca, "xtickmode", "auto", "ytickmode", "auto", "ztickmode", "auto");
       set (ca, "xticklabelmode", "auto", "yticklabelmode", "auto",
 	   "zticklabelmode", "auto");
+      set (ca, "visible", "on");
     elseif (strcmp (ax, "off"))
       set (ca, "xtick", [], "ytick", [], "ztick", []);
+      set (ca, "visible", "off");
     elseif (len > 3 && strcmp (ax(1:3), "tic"))
       if (any (ax == "x"))
 	set (ca, "xtickmode", "auto");
--- a/scripts/plot/subplot.m	Wed Jun 27 19:02:59 2007 +0000
+++ b/scripts/plot/subplot.m	Thu Jun 28 15:25:44 2007 +0000
@@ -120,6 +120,13 @@
 
   found = false;
   for child = obj.children
+    ## Check if this child is still valid; this might not be the case
+    ## anymore due to the deletion of previous children (due to DeleteFcn
+    ## callback or for legends/colorbars that get deleted with their
+    ## corresponding axes)
+    if (! ishandle (child))
+      continue;
+    endif
     obj = get (child);
     if (strcmp (obj.type, "axes"))
       objpos = obj.outerposition;
--- a/src/ChangeLog	Wed Jun 27 19:02:59 2007 +0000
+++ b/src/ChangeLog	Thu Jun 28 15:25:44 2007 +0000
@@ -1,3 +1,10 @@
+2007-06-28  John W. Eaton  <jwe@octave.org>
+
+	* graphics.h (axes::axes_properties::visible): New data member.
+	* graphics.cc (axes::axes_properties::axes_properties, 
+	axes::axes_properties::set, axes::axes_properties::get, 
+	axes::axes_properties::factory_defaults): Handle visible property.
+
 2007-06-27  Kai Habel  <kai.habel@gmx.de>
 
 	* graphics.h (color_values::color_values): Arg is now std:string
--- a/src/graphics.cc	Wed Jun 27 19:02:59 2007 +0000
+++ b/src/graphics.cc	Thu Jun 28 15:25:44 2007 +0000
@@ -921,6 +921,7 @@
     ydir ("normal"),
     zdir ("normal"),
     view (),
+    visible ("on"),
     nextplot ("replace"),
     outerposition ()
 {
@@ -1108,6 +1109,8 @@
     zdir = val;
   else if (name.compare ("view"))
     view = val;
+  else if (name.compare ("visible"))
+    visible = val;
   else if (name.compare ("nextplot"))
     nextplot = val;
   else if (name.compare ("outerposition"))
@@ -1176,6 +1179,7 @@
   tview(1) = 90;
   view = tview;
 
+  visible = "on";
   nextplot = "replace";
 
   // FIXME -- this is not quite right; we should preserve
@@ -1259,6 +1263,7 @@
   m.assign ("ydir", ydir);
   m.assign ("zdir", zdir);
   m.assign ("view", view);
+  m.assign ("visible", visible);
   m.assign ("nextplot", nextplot);
   m.assign ("outerposition", outerposition);
 
@@ -1382,6 +1387,8 @@
     retval = zdir;
   else if (name.compare ("view"))
     retval = view;
+  else if (name.compare ("visible"))
+    retval = visible;
   else if (name.compare ("nextplot"))
     retval = nextplot;
   else if (name.compare ("outerposition"))
@@ -1481,6 +1488,7 @@
 
   m["view"] = tview;
 
+  m["visible"] = "on";
   m["nextplot"] = "replace";
 
   Matrix touterposition (1, 4, 0.0);
--- a/src/graphics.h	Wed Jun 27 19:02:59 2007 +0000
+++ b/src/graphics.h	Thu Jun 28 15:25:44 2007 +0000
@@ -1208,6 +1208,7 @@
     OCTAVE_GRAPHICS_PROPERTY (octave_value, ydir);
     OCTAVE_GRAPHICS_PROPERTY (octave_value, zdir);
     OCTAVE_GRAPHICS_PROPERTY (octave_value, view);
+    OCTAVE_GRAPHICS_PROPERTY (octave_value, visible);
     OCTAVE_GRAPHICS_PROPERTY (octave_value, nextplot);
     OCTAVE_GRAPHICS_PROPERTY (octave_value, outerposition);