# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1360167415 18000 # Node ID a60b6911842cf4d9f5e32f425cfce766bfab5f8d # Parent 9978c44ab12cce04c56bb2fae704e6ac6daacad8# Parent 1045790f9be4a33d0a23224def855e0295f13c05 Merge in Michael's changes diff -r 9978c44ab12c -r a60b6911842c libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Wed Feb 06 11:16:37 2013 -0500 +++ b/libinterp/corefcn/cellfun.cc Wed Feb 06 11:16:55 2013 -0500 @@ -1141,7 +1141,8 @@ if (nargin < 2) { - error ("arrayfun: function requires at least 2 arguments"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: function requires at least 2 arguments"); print_usage (); return retval; } @@ -1172,7 +1173,8 @@ func = symbol_table::find_function (name); if (func.is_undefined ()) - error ("arrayfun: invalid function NAME: %s", name.c_str ()); + error_with_id ("Octave:invalid-input-arg", + "arrayfun: invalid function NAME: %s", name.c_str ()); symbol_table_lookup = true; } @@ -1250,7 +1252,8 @@ { if (mask[i] && inputs[i].dims () != fdims) { - error ("arrayfun: dimensions mismatch"); + error_with_id ("Octave:invalid-input-arg", + "arrayfun: dimensions mismatch"); return retval; } } @@ -1297,7 +1300,8 @@ if (nargout > 0 && tmp.length () < nargout) { - error ("arrayfun: function returned fewer than nargout values"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: function returned fewer than nargout values"); return retval; } @@ -1322,7 +1326,8 @@ retv[j] = val.resize (fdims); else { - error ("arrayfun: all values must be scalars when UniformOutput = true"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: all values must be scalars when UniformOutput = true"); break; } } @@ -1349,7 +1354,8 @@ } else { - error ("arrayfun: all values must be scalars when UniformOutput = true"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: all values must be scalars when UniformOutput = true"); break; } } @@ -1407,7 +1413,8 @@ if (nargout > 0 && tmp.length () < nargout) { - error ("arrayfun: function returned fewer than nargout values"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: function returned fewer than nargout values"); return retval; } @@ -1438,7 +1445,8 @@ } } else - error ("arrayfun: argument NAME must be a string or function handle"); + error_with_id ("Octave:invalid-fun-call", + "arrayfun: argument NAME must be a string or function handle"); return retval; } diff -r 9978c44ab12c -r a60b6911842c scripts/plot/legend.m --- a/scripts/plot/legend.m Wed Feb 06 11:16:37 2013 -0500 +++ b/scripts/plot/legend.m Wed Feb 06 11:16:55 2013 -0500 @@ -874,6 +874,7 @@ if (addprops) addlistener (hlegend, "edgecolor", @updatelegendtext); addlistener (hlegend, "textcolor", @updatelegendtext); + addlistener (hlegend, "fontsize", @updatelegendtext); addlistener (hlegend, "interpreter", @updatelegendtext); addlistener (hlegend, "location", @updatelegend); addlistener (hlegend, "orientation", @updatelegend); @@ -915,7 +916,10 @@ text_kids = findobj (kids, "-property", "interpreter", "type", "text"); interpreter = get (h, "interpreter"); textcolor = get (h, "textcolor"); - set (text_kids, "interpreter", interpreter, "color", textcolor); + fontsize = get (h, "fontsize"); + set (text_kids, "interpreter", interpreter, + "fontsize", fontsize, + "color", textcolor); endfunction function hideshowlegend (h, d, ca, pos1, pos2) diff -r 9978c44ab12c -r a60b6911842c scripts/plot/private/__go_draw_axes__.m --- a/scripts/plot/private/__go_draw_axes__.m Wed Feb 06 11:16:37 2013 -0500 +++ b/scripts/plot/private/__go_draw_axes__.m Wed Feb 06 11:16:55 2013 -0500 @@ -1591,7 +1591,19 @@ else fontspec = ""; endif - colorspec = get_text_colorspec (hlgnd.textcolor, mono); + textcolors = get (findobj (hlgnd.children, "type", "text"), "color"); + if (iscell (textcolors)) + textcolors = cell2mat (textcolors); + textcolors = unique (textcolors, "rows"); + endif + if (rows (textcolors) > 1) + ## Gnuplot is unable to assign arbitrary colors to each text entry + ## for the key/legend. But, the text color can be set to match the + ## color of the plot object. + colorspec = "textcolor variable"; + else + colorspec = get_text_colorspec (textcolors, mono); + endif fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s %s;\n", inout, pos, box, reverse, horzvert, fontspec, colorspec); else @@ -2350,7 +2362,7 @@ persistent sym = __setup_sym_table__ (); persistent flds = fieldnames (sym); - [s, e, m] = regexp (str,'\\\\([a-zA-Z]+|0)','start','end','matches'); + [s, e, m] = regexp (str, "\\\\([a-zA-Z]+|0)", "start", "end", "matches"); for i = length (s) : -1 : 1 ## special case for "\0" and replace with "{/Symbol \306}'