# HG changeset patch # User Ben Abbott # Date 1241831465 14400 # Node ID ad33527d2e51021354ec3a5a76b1f4592e7792cb # Parent 7a10410db2c68858f81bfdc7f94df6e57c25744b Have 'legend' inherit font properties from the parent axis. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-05-08 Ben Abbott + + * 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 * miscellaneous/tar.m, miscellaneous/unpack.m: diff --git a/scripts/plot/__gnuplot_has_feature__.m b/scripts/plot/__gnuplot_has_feature__.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}); diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- 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