# HG changeset patch # User Ben Abbott # Date 1249535933 -7200 # Node ID f3bf489b73228254129c76b299cf92bf506dfd60 # Parent 3df527f71cee4c32e44203a52190b268f45138eb __go_draw_axes__.m: Fix ticklabels specified as 2D character array. diff -r 3df527f71cee -r f3bf489b7322 scripts/ChangeLog --- a/scripts/ChangeLog Tue Aug 04 09:55:38 2009 +0200 +++ b/scripts/ChangeLog Thu Aug 06 07:18:53 2009 +0200 @@ -1,3 +1,8 @@ +2009-07-29 Ben Abbott + + * plot/__go_draw_axes__.m: Fix ticklabels specified as 2D character + array. + 2009-07-17 John W. Eaton * plot/__go_draw_axes__.m: Use "layer" property to decide whether diff -r 3df527f71cee -r f3bf489b7322 scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Tue Aug 04 09:55:38 2009 +0200 +++ b/scripts/plot/__go_draw_axes__.m Thu Aug 06 07:18:53 2009 +0200 @@ -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