Mercurial > hg > octave-lyh
diff scripts/plot/__gnuplot_drawnow__.m @ 16095:1339c964b527
Fix warning when using "termoption dashed" with gnuplot 4.2.X (bug #38370)
* scripts/plot/__gnuplot_drawnow__.m: Test whether gnuplot is new enough
to have "termoption dashed". If not, set the dashed option directly when
the terminal is set.
test for "has_termoption_dashed".
author | Rik <rik@octave.org> |
---|---|
date | Sun, 24 Feb 2013 07:25:56 -0800 |
parents | 1ea5f8a4a914 |
children | 3cce6b4e0f7c |
line wrap: on
line diff
--- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -297,6 +297,16 @@ term_str = sprintf ("%s %s", term_str, size_str); endif endif + if (! __gnuplot_has_feature__ ("has_termoption_dashed")) + ## If "set termoption dashed" isn't available add "dashed" option + ## to the "set terminal ..." command, if it is supported. + if (any (strcmpi (term, {"aqua", "cgm", "eepic", "emf", "epslatex", \ + "fig", "pcl5", "mp", "next", "openstep", "pdf", \ + "pdfcairo", "pngcairo", "postscript", \ + "pslatex", "pstext", "svg", "tgif", "x11"}))) + term_str = sprintf ("%s dashed", term_str); + endif + end ## Work around the gnuplot feature of growing the x11 window and ## flickering window (x11, windows, & wxt) when the mouse and @@ -321,7 +331,9 @@ endif endif endif - fprintf (plot_stream, "set termoption dashed\n") + if (__gnuplot_has_feature__ ("has_termoption_dashed")) + fprintf (plot_stream, "set termoption dashed\n") + endif else ## gnuplot will pick up the GNUTERM environment variable itself ## so no need to set the terminal type if not also setting the