0
私はJavaからのgnuplotを開くには、このコードを使用しますが、私はgnuplotのへの入力として次のJava文字列を送信する方法がわからない:java文字列をjavaからgnuplotへの入力としてどのように送るのですか?
sp 'F:\DataJava\PDE\EqStringSin.dat' w l
私のクラス:
public class executeCommand {
public static void main(String[] args) {
try {
ProcessBuilder pb = new ProcessBuilder("wgnuplot");
Process p = pb.start(); // Start the process.
p.waitFor(); // Wait for the process to finish.
System.out.println("Script executed successfully");
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
: 'プロセスp = pb.start(); //プロセスを開始します。 \t \t \t新規のOutputStreamWriter(p.getOutputStream())を書き込む( "SP 'F:\\ DataJava \\ PDE \\ EqStringSin.dat W' のL")。 \t \t \t ' –