Gnuplot直方图键
我正在尝试创建一个直方图,显示UDP和TCP流量的Internet数据包大小。我正在使用下面的gnuplot代码Gnuplot直方图键,gnuplot,histogram,Gnuplot,Histogram,我正在尝试创建一个直方图,显示UDP和TCP流量的Internet数据包大小。我正在使用下面的gnuplot代码 set terminal eps set output 'packet_size_2012.eps' set boxwidth 0.75 absolute set style fill solid 1.00 border lt -1 set key inside noenhanced nobox set key invert samplen 4 spacing 1 width 0
set terminal eps
set output 'packet_size_2012.eps'
set boxwidth 0.75 absolute
set style fill solid 1.00 border lt -1
set key inside noenhanced nobox
set key invert samplen 4 spacing 1 width 0 height 0
set style histogram rowstacked title offset character 0, 0, 0
set style data histograms
set ylabel "Percentage of Packets (%) "
set xlabel "Frame Size (bytes)"
set xtics border in scale 0,0 nomirror rotate by -45 autojustify
set yrange [ 0 : 50 ] noreverse nowriteback
plot 'packet_size_percent_2012.dat' using 2:xtic(1), for [i=3:3] '' using i
我使用的数据集文件名为packet_size_percent_2012.dat
Size TCP UDP
>100 37.9751914726 3.8006927347
>200 2.40410662 1.2339364475
>300 1.214213436 0.2644495664
>400 2.8001210777 0.1767652772
>500 0.8650757197 0.0724963219
>600 0.8767813751 0.1582132766
>700 0.4833217953 0.067857265
>800 0.4663420621 0.0625691477
>900 0.4081899064 0.0389895145
>1000 0.4181337618 0.0364423356
>1100 0.5492004791 0.4992289447
>1200 0.3614408031 0.4492694873
>1300 11.1826219794 0.0841426493
>1400 2.2600786977 0.4211750387
>1518 29.0098254538 1.3591273532
绘图已生成,看起来不错,但关键点全错了。有人能解释一下如何修复键吗?使用
设置键自动列标题
实际列标题用作键条目(我想这就是您的意图):
使用
set key auto columnheader
将实际列标题用作键条目(我想这就是您的意图):