Hallo Ich versuche, ein gnuplot-Skript zu schreiben, das CDF-Diagramm für die Daten produzierte von einem anderen Programm produziert. Plot CDF mit GNUPLOT mit Daten nicht sortiert
Die Daten sieht wie folgt aus:
col1 col2 col3 col4 col5
ABCD11 19.8 1.13 129 2
AABC32 14.3 2.32 109 2
AACd12 19.1 0.21 103 2
Ich möchte CDF plotten für die Spalte 2. Der Punkt ist, dass die Daten in der col2
möglicherweise nicht sortiert werden.
das Skript zu kompilieren ich Online-Tool verwenden, wie here
Das Skript habe ich versucht, ist:
set output 'out.svg'
set terminal svg size 600,300 enhanced fname 'arial' fsize 10 mousing butt solid
set xlabel "X"
set ylabel "CDF"
set style line 2 lc rgb 'black' lt 1 lw 1
set xtics format "" nomirror rotate by -10 font ", 7"
set ytics nomirror
set grid ytics
set key box height .4 width -1 box right
set nokey
set title "CDF of X"
a=0
#gnuplot 4.4+ functions are now defined as:
#func(variable1,variable2...)=(statement1,statement2,...,return value)
cumulative_sum(x)=(a=a+x,a)
plot "data.txt" using 1:(cumulative_sum($2)) with linespoints lt -1
Auch Rohre wie "Handlung"
ShinQian