changeset 12051:f3bf489b7322 release-3-2-x

__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
author Ben Abbott <bpabbott@mac.com>
date Thu, 06 Aug 2009 07:18:53 +0200
parents 3df527f71cee
children b50d1eb62747
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-29  Ben Abbott <bpabbott@mac.com>
+
+	* plot/__go_draw_axes__.m: Fix ticklabels specified as 2D character
+	array.
+
 2009-07-17  John W. Eaton  <jwe@octave.org>
 
 	* plot/__go_draw_axes__.m: Use "layer" property to decide whether
--- a/scripts/plot/__go_draw_axes__.m
+++ b/scripts/plot/__go_draw_axes__.m
@@ -1728,17 +1728,19 @@
 endfunction
 
 function ticklabel = ticklabel_to_cell (ticklabel)
-  if (! isempty (ticklabel) && ! iscell (ticklabel))
-    if (isnumeric (ticklabel))
-      ## Use upto 5 significant digits
-      ticklabel = num2str (ticklabel(:), 5);
-    endif
-    n = setdiff (findstr (ticklabel, '|'), findstr (ticklabel, '\|'));
-    if (! isempty (n))
+  if (isnumeric (ticklabel))
+    ## Use upto 5 significant digits
+    ticklabel = num2str (ticklabel(:), 5);
+  endif
+  if (ischar (ticklabel))
+    if (size (ticklabel, 1) == 1 && any (ticklabel == "|"))
+      n = setdiff (findstr (ticklabel, "|"), findstr (ticklabel, '\|'));
       ticklabel = strsplit (ticklabel, "|");
     else
       ticklabel = cellstr (ticklabel);
     endif
+  elseif (isempty (ticklabel))
+    ticklabel = {""};
   else
     ticklabel = ticklabel;
   endif