0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gnuplotで複数のファイルを描画する

Posted at

基本系

plot "file1.txt" u 1:2, "file2.txt" u 1:2, "file3.txt" u 1:2

,で区切る

ラベリングされている場合

plot forを使うと便利。

下記4つは同じ。

plot for [i in "1 2 3"] i".txt" u 1:2
plot for [i=1:3] i".txt" u 1:2
plot for [i=1:3] sprintf("%d.txt",i) u 1:2
plot "1.txt" u 1:2, "2.txt" u 1:2, "3.txt" u 1:2

複雑なファイル名

sprintf()関数を使う。
下記二つは同じ

plot for [i=50:150:50] sprintf("out_%03d.txt",i) u 1:2 w l t sprintf("%d",i)
plot out_050.txt u 1:2 w l t 50,  out_100.txt u 1:2 w l t 100,  out_150.txt u 1:2 w l t 150
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?