changeset 9191:ad33527d2e51

Have 'legend' inherit font properties from the parent axis.
author Ben Abbott <bpabbott@mac.com>
date Fri, 08 May 2009 21:11:05 -0400
parents 7a10410db2c6
children 864805896876
files scripts/ChangeLog scripts/plot/__gnuplot_has_feature__.m scripts/plot/__go_draw_axes__.m
diffstat 3 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-08  Ben Abbott <bpabbott@mac.com>
+
+	* plot/__gnuplot_has_feature__.m: Add feature "key_has_font_properties".
+	* plot/__go_draw_axes__.m: Have legend inherit the axis font-name/size.
+
 2009-05-04  Peter O'Gorman  <pogma@thewrittenword.com>
 
 	* miscellaneous/tar.m, miscellaneous/unpack.m:
--- a/scripts/plot/__gnuplot_has_feature__.m
+++ b/scripts/plot/__gnuplot_has_feature__.m
@@ -30,12 +30,13 @@
               "epslatex_implies_eps_filesuffix",
               "epslatexstandalone_terminal",
               "screen_coordinates_for_{lrtb}margin",
-              "variable_GPVAL_TERMINALS"};
+              "variable_GPVAL_TERMINALS",
+              "key_has_font_properties"};
 
   if (isempty (has_features))
     gnuplot_version = __gnuplot_version__ ();
-    versions = {"4.3", "4.3", "4.3", "4.2", "4.2", "4.3", "4.3"};
-    operators = {">=", ">=", ">=", ">=", ">=", ">=", ">="};
+    versions = {"4.3", "4.3", "4.3", "4.2", "4.2", "4.3", "4.3", "4.3"};
+    operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="};
     have_features = logical (zeros (size (features)));
     for n = 1 : numel (have_features)
       has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});
--- a/scripts/plot/__go_draw_axes__.m
+++ b/scripts/plot/__go_draw_axes__.m
@@ -1209,7 +1209,13 @@
 	otherwise
 	  pos = "";
       endswitch
-      fprintf (plot_stream, "set key %s %s %s %s;\n", inout, pos, box, reverse);
+      if (__gnuplot_has_feature__ ("key_has_font_properties"))
+        fontspec = create_fontspec (axis_obj.fontname, axis_obj.fontsize);
+      else
+	fontspec = "";
+      endif
+      fprintf (plot_stream, "set key %s %s %s %s %s;\n", inout, pos, box,
+               reverse, fontspec);
     else
       fputs (plot_stream, "unset key;\n");
     endif