如何使用 gnuplot 绘制包含超过 800,000 个样本的大型数据集
How to plot a large dataset with more than 800,000 samples using gnuplot
我有一个包含 818,741 个样本的数据集。值介于 0 和 7276 之间。我正在使用以下 gnuplot 脚本来绘制数据。
#+begin_src gnuplot :var data=xtics :exports code :file file.png
reset
set term png
set output "data.png"
set title "Variations/entity"
set xlabel "entity"
set xtics rotate by -45
set yrange [0:7276]
set ylabel "# fo variations"
plot 'sort_1.txt' u 2:xticlabels(1) w lp lw 2 notitle
#+end_src
问题
问题是当我使用818,741 samples.I的数据集时,曲线变成了一条直线,再也看不到数据的分布了。你有什么建议。
示例数据
entity # of variations
E0669803 7276
E0726485 496
E0679687 459
E0159288 395
E0018102 337
E0498282 333
E0349508 322
E0566375 315
E0096588 314
E0182788 313
E0595006 312
E0550909 291
E0338738 290
E0031352 290
E0409686 284
E0576457 279
E0277375 275
E0277379 0
更新
以下脚本适用于整个数据集。好吧,我认为我不能做得更好。
#+begin_src gnuplot :var data=xtics :exports code :file file.png
reset
set term png
set output "data.png"
set title "Variations/entity"
set xlabel "entity"
set xtics rotate by -90
set yrange [0:7276]
set ylabel "# fo variations"
plot 'data.txt' u 2:xticlabels(1) every 100000 w lp lw 2 notitle
#+end_src
如果您想从数据样本中提取统计数据,请尝试使用箱线图,每个箱线图对应一个 entity
:
set yrange [0:7276]
set style fill solid 0.25 border -1
set style boxplot nooutliers pointtype 7 separation 2
set boxwidth 1
plot "data.txt" using (1.0):2:(0):1 with boxplot notitle
这会为第一列中具有相同字符串值的所有数据样本创建一个箱线图,您的 "entity"。并为每个唯一实体生成一个箱线图。
我有一个包含 818,741 个样本的数据集。值介于 0 和 7276 之间。我正在使用以下 gnuplot 脚本来绘制数据。
#+begin_src gnuplot :var data=xtics :exports code :file file.png
reset
set term png
set output "data.png"
set title "Variations/entity"
set xlabel "entity"
set xtics rotate by -45
set yrange [0:7276]
set ylabel "# fo variations"
plot 'sort_1.txt' u 2:xticlabels(1) w lp lw 2 notitle
#+end_src
问题
问题是当我使用818,741 samples.I的数据集时,曲线变成了一条直线,再也看不到数据的分布了。你有什么建议。
示例数据
entity # of variations
E0669803 7276
E0726485 496
E0679687 459
E0159288 395
E0018102 337
E0498282 333
E0349508 322
E0566375 315
E0096588 314
E0182788 313
E0595006 312
E0550909 291
E0338738 290
E0031352 290
E0409686 284
E0576457 279
E0277375 275
E0277379 0
更新
以下脚本适用于整个数据集。好吧,我认为我不能做得更好。
#+begin_src gnuplot :var data=xtics :exports code :file file.png
reset
set term png
set output "data.png"
set title "Variations/entity"
set xlabel "entity"
set xtics rotate by -90
set yrange [0:7276]
set ylabel "# fo variations"
plot 'data.txt' u 2:xticlabels(1) every 100000 w lp lw 2 notitle
#+end_src
如果您想从数据样本中提取统计数据,请尝试使用箱线图,每个箱线图对应一个 entity
:
set yrange [0:7276]
set style fill solid 0.25 border -1
set style boxplot nooutliers pointtype 7 separation 2
set boxwidth 1
plot "data.txt" using (1.0):2:(0):1 with boxplot notitle
这会为第一列中具有相同字符串值的所有数据样本创建一个箱线图,您的 "entity"。并为每个唯一实体生成一个箱线图。