开发者

How to stop gnuplot window poping-up when using it from command line in windows?

I am using perl to open a pipe to pgnuplot.exe to output plot commands. For example,

开发者_JAVA技巧open ($PLOT, "|pgnuplot") or die "error: gnuplot not found!";

print $PLOT <<EOPLOT;

set term postscript eps enhanced "Arial" 20
set output "somefile.eps"

## do some plotting here ##

EOPLOT

close $PLOT;

I notice that a window for gnuplot always pops up and grabs the focus of my mouse and keyboard momentarily. This makes it difficult to use the computer while the plot script is running.

Is there any way to stop pgnuplot from opening a window?


Yes, when starting a program in Windows (CreateProcess API) it is possible to request that the main window be hidden or minimized without focus (among other options). But I don't know whether perl provides a easy way to do that.

You might consider using batch operation instead (put your plot commands in a file, then pass the filename to gnuplot).


You can prevent showing child console windows via Win32 module:

use Win32;
Win32::SetChildShowWindow(0);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜