如何在窗口中使用命令行来停止gnuplot窗口弹出? [英] How to stop gnuplot window poping-up when using it from command line in windows?

查看:875
本文介绍了如何在窗口中使用命令行来停止gnuplot窗口弹出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用perl打开一个管道到pgnuplot.exe以输出绘图命令。例如,

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

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;

我注意到gnuplot的窗口总是弹出并暂时抓住鼠标和键盘的焦点。这使得在剧情脚本运行时难以使用计算机。

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.

有什么方法可以阻止pgnuplot打开窗口吗?

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

推荐答案

是的,当在Windows( CreateProcess API)中启动一个程序时,窗口被隐藏或最小化(无其他选项)。但我不知道perl是否提供了一个简单的方法来做到这一点。

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.

您可以考虑使用批处理操作(将绘图命令放入文件,然后将文件名传递给gnuplot)。

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

这篇关于如何在窗口中使用命令行来停止gnuplot窗口弹出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆