Mercurial > hg > octave-kai
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 +++ b/scripts/ChangeLog @@ -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 +++ 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