changeset 16007:a60b6911842c

Merge in Michael's changes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 06 Feb 2013 11:16:55 -0500
parents 9978c44ab12c (current diff) 1045790f9be4 (diff)
children 6f567476e6f0
files
diffstat 3 files changed, 35 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }
--- 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)
--- 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}'