# HG changeset patch # User Ben Abbott # Date 1252907715 -7200 # Node ID f12b581a157283183ab91b8ad35c226af8f0f7ef # Parent f859b61b8bf4dbfd1328ae7bb873c6c853bbce78 gnuplot_drawnow.m: Avoid flickering plot windows. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -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-08 John W. Eaton * io/dlmwrite.m: Fix typo. diff --git a/scripts/plot/gnuplot_drawnow.m b/scripts/plot/gnuplot_drawnow.m --- a/scripts/plot/gnuplot_drawnow.m +++ b/scripts/plot/gnuplot_drawnow.m @@ -286,10 +286,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); @@ -299,7 +301,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))