# HG changeset patch # User John W. Eaton # Date 1205288570 14400 # Node ID 61244c9d99b3dfbab21a9ac8b6d18fd2fde626d1 # Parent e77150aa1ac26a60cc59cf2024f2938a71edb72a handle axes linewidth property diff -r e77150aa1ac2 -r 61244c9d99b3 scripts/ChangeLog --- a/scripts/ChangeLog Tue Mar 11 22:07:27 2008 -0400 +++ b/scripts/ChangeLog Tue Mar 11 22:22:50 2008 -0400 @@ -1,5 +1,7 @@ 2008-03-11 John W. Eaton + * plot/ChangeLog: Handle axes linewidth property. + * plot/__go_draw_axes__.m (get_old_gnuplot_color): New subfunction. Use it to replace repeated if/elseif blocks. diff -r e77150aa1ac2 -r 61244c9d99b3 scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Tue Mar 11 22:07:27 2008 -0400 +++ b/scripts/plot/__go_draw_axes__.m Tue Mar 11 22:22:50 2008 -0400 @@ -579,7 +579,7 @@ color = cmap(r, :); endif elseif (strncmp (obj.facecolor, "interp", 6)) - warning ("\"interp\" not supported, using 1st entry of cdata") + warning ("\"interp\" not supported, using 1st entry of cdata"); r = 1 + round ((size (cmap, 1) - 1) * ccol(1)); r = max (1, min (r, size (cmap, 1))); color = cmap(r,:); @@ -654,7 +654,7 @@ color = cmap(r, :); endif elseif (strncmp (obj.edgecolor, "interp", 6)) - warning ("\"interp\" not supported, using 1st entry of cdata") + warning ("\"interp\" not supported, using 1st entry of cdata"); r = 1 + round ((size (cmap, 1) - 1) * ccol(1)); r = max (1, min (r, size (cmap, 1))); color = cmap(r,:); @@ -687,6 +687,16 @@ lt = ""; endif + if (isfield (obj, "linewidth")) + if (have_newer_gnuplot) + lw = sprintf("linewidth %f", obj.linewidth); + else + lw = sprintf("lw %f", obj.linewidth); + endif + else + lw = ""; + endif + if (isfield (obj, "marker")) if (isfield (obj, "marker")) switch (obj.marker) @@ -761,12 +771,13 @@ colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", round (255*color)); endif - withclause{data_idx} = sprintf ("with %s %s %s %s %s", - style, pt, lt, ps, colorspec); + withclause{data_idx} = sprintf ("with %s %s %s %s %s %s", + style, lw, pt, lt, ps, + colorspec); else typ = get_old_gnuplot_color (color); - withclause{data_idx} = sprintf ("with %s %s %s lt %d", - style, pt, ps, typ); + withclause{data_idx} = sprintf ("with %s %s %s %s lt %d", + style, lw, pt, ps, typ); endif if (nd == 3) @@ -1052,6 +1063,8 @@ if (strcmpi (axis_obj.visible, "off")) fputs (plot_stream, "unset border; unset tics\n"); + else + fprintf (plot_stream, "set border lw %f;\n", axis_obj.linewidth); endif if (strcmpi (axis_obj.key, "on")) @@ -1337,7 +1350,7 @@ if (isfield (obj, "markersize")) if (have_newer_gnuplot) - fprintf (plot_stream, " pointsize %f", obj.markersize /6); + fprintf (plot_stream, " pointsize %f", obj.markersize / 6); else if (! strcmpi (style, "lines")) with = sprintf ("%s ps %f", with, obj.markersize / 6); @@ -1490,7 +1503,7 @@ endif labels = regexprep(labels, "%", "%%"); for i = 1:ntics - fprintf (plot_stream, " \"%s\" %g", labels{k++}, tics(i)) + fprintf (plot_stream, " \"%s\" %g", labels{k++}, tics(i)); if (i < ntics) fputs (plot_stream, ", "); endif