# HG changeset patch # User Ben Abbott # Date 1252539689 14400 # Node ID 40acd13920e36f2e0ac9318cf9f96017ecd8a515 # Parent 00958d0c4e3cf232305d184c5d519906633a1447 gnuplot_drawnow.m: Avoid flickering plot windows. diff -r 00958d0c4e3c -r 40acd13920e3 scripts/ChangeLog --- a/scripts/ChangeLog Wed Sep 09 14:43:06 2009 +0200 +++ b/scripts/ChangeLog Wed Sep 09 19:41:29 2009 -0400 @@ -1,3 +1,9 @@ +2009-09-09 Tatsuro Matsuoka + + * plot/gnuplot_drawnow.m: Avoid flickering windows by avoding + 'set multiplot' / 'unset multiplot' for gnuplot's windows and + wxt terminals. + 2009-09-06 Jaroslav Hajek * optimization/__dogleg__.m: Revert to revision 22c8272af34b. diff -r 00958d0c4e3c -r 40acd13920e3 scripts/plot/gnuplot_drawnow.m --- a/scripts/plot/gnuplot_drawnow.m Wed Sep 09 14:43:06 2009 +0200 +++ b/scripts/plot/gnuplot_drawnow.m Wed Sep 09 19:41:29 2009 -0400 @@ -288,10 +288,12 @@ ## the canvas size for terminals cdr/corel. term_str = sprintf ("%s %s", term_str, size_str); endif - ## Work around the gnuplot feature of growing the x11 window when - ## the mouse and multiplot are set. + ## Work around the gnuplot feature of growing the x11 window and + ## flickering window (x11, windows, & wxt) when the mouse and + ## multiplot are set in gnuplot. fputs (plot_stream, "unset multiplot;\n"); - if (! strcmp (term, "x11") + flickering_terms = {"x11", "windows", "wxt"}; + if (! any (strcmp (term, flickering_terms)) || numel (findall (h, "type", "axes")) > 1 || numel (findall (h, "type", "image")) > 0) fprintf (plot_stream, "%s\n", term_str); @@ -301,7 +303,7 @@ endif endif fputs (plot_stream, "set multiplot;\n"); - elseif (strcmp (term, "x11")) + elseif (any (strcmp (term, flickering_terms))) fprintf (plot_stream, "%s\n", term_str); if (nargin == 5) if (! isempty (file))