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 1 year has passed since last update.

gnuplot テンプレ - データに数式適用して描画/epsファイルへの出力

0
Posted at

超久しぶりにgnuplotを使ったときに色々忘れてたのでメモ書き。

テンプレ.plt

# 設定をリセット
reset
# 出力先を画面に設定
set terminal window

set xlabel "N"
set ylabel ""
# 対数軸の設定
set logscale x
# 範囲指定
set xr [1000:]
# カレントフォルダ移動
cd 'C:\ログデータのあるフォルダ'

# epsファイルに出力する場合はこのコメントアウトを外す
# set terminal postscript eps enhanced color
# set output "sighat.eps"

# プロット。複数系列プロットするときはカンマで区切る
plot 'ログファイル名.txt' using 1:(log(1-$2*$3)) w l axis x1y1 title "系列の名前", 'ログファイル名.txt' using 1:(log(1-$4)) w lp axis x1y1 title "系列の名前"

  • データに対して数式を適用してプロットしたいときは using x指定:y指定x指定y指定の部分を括弧で囲み、系列番号を$と数字で表すと行ける。

  • ログファイル内のデータは、#でコメントアウト可能。メモ代わりにヘッダ行を入れられて便利。

  • ログファイル内のデータに空行を挟むとプロットがそこで不連続になる。意図的に空行を入れることで分離した曲線を描ける。

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?