# HG changeset patch # User Rik # Date 1372116859 25200 # Node ID 2ce1ddead134a67f8fcf930cd59055930d1fbb17 # Parent 969233a27bcea815815fae38108f6c42e3c97281 Return a cellstr column vector for ticklabels (bug #34906). * libinterp/interpfcn/graphics.cc(convert_ticklabel_string): Check for cellstr row vector input and reshape it to column vector. diff --git a/libinterp/interpfcn/graphics.cc b/libinterp/interpfcn/graphics.cc --- a/libinterp/interpfcn/graphics.cc +++ b/libinterp/interpfcn/graphics.cc @@ -2078,7 +2078,7 @@ %! xticklabel = get (gca (), "xticklabel"); %! assert (class (xticklabel), "char"); %! assert (size (xticklabel), [6, 3]); -%!xtest +%!test %! set (gcf (), "visible", "off"); %! set (gca (), "xticklabel", {"0", "0.2", "0.4", "0.6", "0.8", "1"}); %! xticklabel = get (gca (), "xticklabel"); @@ -5748,7 +5748,13 @@ { octave_value retval = val; - if (!val.is_cellstr ()) + if (val.is_cellstr ()) + { + // Always return a column vector for Matlab Compatibility + if (val.columns () > 1) + retval = val.reshape (dim_vector (val.numel (), 1)); + } + else { string_vector str; if (val.is_numeric_type ()) @@ -5784,8 +5790,8 @@ ch(i) = ' '; retval = octave_value (ch); - - } + } + return retval; }