# HG changeset patch # User Ben Abbott # Date 1223757879 14400 # Node ID 302abc43820b0ea46136396b30658d3ca379351e # Parent a10397d26114998bca6c7c5570eb2feb40f77b91 __go_draw_axes__.m: Axis font properites for tic labels. diff -r a10397d26114 -r 302abc43820b scripts/ChangeLog --- a/scripts/ChangeLog Fri Oct 10 15:10:58 2008 -0400 +++ b/scripts/ChangeLog Sat Oct 11 16:44:39 2008 -0400 @@ -1,3 +1,7 @@ +2008-10-11 Ben Abbott + + * plot/__go_draw_axes__.m: Axis font properites for tic labels. + 2008-10-10 David Bateman * image/__img__.m: Manually set the limits of th eimage diff -r a10397d26114 -r 302abc43820b scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Fri Oct 10 15:10:58 2008 -0400 +++ b/scripts/plot/__go_draw_axes__.m Sat Oct 11 16:44:39 2008 -0400 @@ -1383,51 +1383,64 @@ endfunction function do_tics (obj, plot_stream, ymirror, mono) + [fontname, fontsize] = get_fontname_and_size (obj); if (strcmpi (obj.xaxislocation, "top")) do_tics_1 (obj.xtickmode, obj.xtick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "border", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.xticklabelmode, obj.xticklabel, - obj.xcolor, "x", plot_stream, true, mono, "border", ""); + obj.xcolor, "x", plot_stream, true, mono, "border", + "", fontname, fontsize); elseif (strcmpi (obj.xaxislocation, "zero")) do_tics_1 (obj.xtickmode, obj.xtick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "axis", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.xticklabelmode, obj.xticklabel, - obj.xcolor, "x2", plot_stream, true, mono, "axis", ""); + obj.xcolor, "x2", plot_stream, true, mono, "axis", + "", fontname, fontsize); else do_tics_1 (obj.xtickmode, obj.xtick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "border", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.xticklabelmode, obj.xticklabel, - obj.xcolor, "x2", plot_stream, true, mono, "border", ""); + obj.xcolor, "x2", plot_stream, true, mono, "border", + "", fontname, fontsize); endif if (strcmpi (obj.yaxislocation, "right")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "border", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.yticklabelmode, obj.yticklabel, - obj.ycolor, "y", plot_stream, ymirror, mono, "border", ""); + obj.ycolor, "y", plot_stream, ymirror, mono, "border", + "", fontname, fontsize); elseif (strcmpi (obj.xaxislocation, "zero")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "axis", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.yticklabelmode, obj.yticklabel, - obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", ""); + obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", + "", fontname, fontsize); else do_tics_1 (obj.ytickmode, obj.ytick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "border", - obj.tickdir); + obj.tickdir, fontname, fontsize); do_tics_1 ("manual", [], obj.yticklabelmode, obj.yticklabel, - obj.ycolor, "y2", plot_stream, ymirror, mono, "border", ""); + obj.ycolor, "y2", plot_stream, ymirror, mono, "border", + "", fontname, fontsize); endif do_tics_1 (obj.ztickmode, obj.ztick, obj.zticklabelmode, obj.zticklabel, obj.zcolor, "z", plot_stream, true, mono, "border", - obj.tickdir); + obj.tickdir, fontname, fontsize); endfunction function do_tics_1 (ticmode, tics, labelmode, labels, color, ax, - plot_stream, mirror, mono, axispos, tickdir) + plot_stream, mirror, mono, axispos, tickdir, + fontname, fontsize) + if (strcmp (fontname, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", fontname, fontsize); + endif colorspec = get_text_colorspec (color, mono); if (strcmpi (ticmode, "manual") || strcmpi (labelmode, "manual")) if (isempty (tics)) @@ -1458,7 +1471,7 @@ k = 1; endif endfor - fprintf (plot_stream, ") %s;\n", colorspec); + fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); else error ("unsupported type of ticklabel"); endif @@ -1472,16 +1485,16 @@ axispos); endif fprintf (plot_stream, " %.15g,", tics(1:end-1)); - fprintf (plot_stream, " %.15g);\n", tics(end)); + fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec); endif else fprintf (plot_stream, "set format %s \"%%g\";\n", ax); if (mirror) - fprintf (plot_stream, "set %stics %s %s mirror %s;\n", ax, - axispos, tickdir, colorspec); + fprintf (plot_stream, "set %stics %s %s %s %s;\n", ax, axispos, tickdir, + colorspec, fontspec); else - fprintf (plot_stream, "set %stics %s %s nomirror %s;\n", ax, - tickdir, axispos, colorspec); + fprintf (plot_stream, "set %stics %s %s nomirror %s %s;\n", ax, + tickdir, axispos, colorspec, fontspec); endif endif endfunction