LoginSignup
9
7

More than 5 years have passed since last update.

gnuplotでワイルドカードを使用する方法

Last updated at Posted at 2014-09-03

以下のようにスクリプトを作りloadすることで擬似ワイルドカードを利用できる。

例:data*.datをまとめてプロットしたい

renbann.plot
list = system("ls data*.dat")
plot for [i=1:words(list)] word(list, i) title word (list, i)

解説

  • system("シェルで実行したいこと")でシェルの結果を受け取れる
  • guplot上でlist = “文字列1 文字列2 文字列3”は配列扱い
  • word(list , i)でアクセスすることが可能
  • words(list)で配列の長さがわかる
  • plot for[i=最初:最後:インクリメント] でループ内容を重ねてプロットという構文になっている。
9
7
2

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
9
7