Bus errorとSegmentation faultに困ったら見るブログ

物理の研究者による日々の研究生活のメモ書きです ( python/emacs/html/Japascript/シェルスクリプト/TeX/Mac/C言語/Linux/git/tmux/R/ポケモンGO)

【gnuplot5】累積分布(cdf)を書く

あるデータの1列目の累積分布を書きたいときは以下のような感じでOK
nはデータ点数、これが間違ってると累積分布が[0:1]の範囲に収まらない

n=100
plot "exp.dat" using 1:(1/n) smooth cumulative

他に必要であろう設定を加えたのが以下の通り

n=100
set size square
set key bottom right
set xlabel "p-value"
set ylabel "cumulative distribution"
plot "p-value.txt" using 1:(1/n) smooth cumul title "simulation", x w l lw 2 title "uniform"

ランキング参加中です

↓クリックしていただけると嬉しいです〜