# HG changeset patch # User David Bateman # Date 1263593397 -3600 # Node ID 1e38d9ed1e283fb744ba5d625e295eec96712e18 # Parent 4de5c28733d59f2cf3611a7c6c0ac0e2d8c0afc9 Respect figure and axes color properties for gnuplot backend diff -r 4de5c28733d5 -r 1e38d9ed1e28 scripts/ChangeLog --- a/scripts/ChangeLog Fri Jan 15 13:22:41 2010 -0500 +++ b/scripts/ChangeLog Fri Jan 15 23:09:57 2010 +0100 @@ -1,3 +1,8 @@ +2010-01-15 David Bateman + + plot/__go_draw_figure__.m: Respect the figure and axes color + properties. + 2010-01-14 David Bateman * plot/__go_draw_axes__.m: Fix for markerfacecolor and diff -r 4de5c28733d5 -r 1e38d9ed1e28 scripts/plot/__go_draw_figure__.m --- a/scripts/plot/__go_draw_figure__.m Fri Jan 15 13:22:41 2010 -0500 +++ b/scripts/plot/__go_draw_figure__.m Fri Jan 15 23:09:57 2010 +0100 @@ -69,6 +69,13 @@ fputs (plot_stream, "set autoscale keepfix;\n"); fputs (plot_stream, "set origin 0, 0\n"); fputs (plot_stream, "set size 1, 1\n"); + bg = get (h, "color"); + if (isnumeric (bg)) + fprintf (plot_stream, "set obj 1 rectangle from screen 0,0 to screen 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * bg); + bg_is_set = true; + else + bg_is_set = false; + endif for i = 1:nkids type = get (kids(i), "type"); switch (type) @@ -78,6 +85,13 @@ orig_axes_position = get (kids(i), "position"); unwind_protect set (kids(i), "units", "normalized"); + fg = get (kids(i), "color"); + if (isnumeric (fg)) + fprintf (plot_stream, "set obj 2 rectangle from graph 0,0 to graph 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * fg); + fg_is_set = true; + else + fg_is_set = false; + endif if (output_to_paper) axes_position_on_page = orig_axes_position .* paper_position([3, 4, 3 ,4]); axes_position_on_page(1:2) = axes_position_on_page(1:2) + paper_position(1:2); @@ -90,6 +104,13 @@ unwind_protect_cleanup set (kids(i), "units", orig_axes_units); set (kids(i), "position", orig_axes_position); + if (fg_is_set) + fputs (plot_stream, "unset obj 2\n"); + endif + if (bg_is_set) + fputs (plot_stream, "unset obj 1\n"); + bg_is_set = false; + endif end_unwind_protect otherwise error ("__go_draw_figure__: unknown object class, %s", type);