diff scripts/plot/__go_draw_axes__.m @ 9472:303f862a896d

__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
author Ben Abbott <bpabbott@mac.com>
date Wed, 29 Jul 2009 19:36:22 -0400
parents 5af462716bff
children 3b7e644bb46d
line wrap: on
line diff
--- a/scripts/plot/__go_draw_axes__.m	Wed Jul 29 18:39:25 2009 -0400
+++ b/scripts/plot/__go_draw_axes__.m	Wed Jul 29 19:36:22 2009 -0400
@@ -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