changeset 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 24df2e66abbe
children 833109a9f37f
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Jul 29 18:39:25 2009 -0400
+++ b/scripts/ChangeLog	Wed Jul 29 19:36:22 2009 -0400
@@ -1,5 +1,7 @@
 2009-07-29  Ben Abbott <bpabbott@mac.com>
 
+	* plot/__go_draw_axes__.m: Fix ticklabels specified as 2D character
+	array.
 	* plot/__go_draw_axes__.m: Ignore fontnames for the Lua-TikZ terminal.
 	* plot/gnuplot_drawnow.m: Support the gnuplot terminal Lua-TikZ.
 	* plot/print.m: Support the gnuplot terminal Lua-TikZ.
--- 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