Gnuplot在y2上添加标签

时间:2016-04-19 16:40:11

标签: label gnuplot gnu

当我尝试在y2上添加标签时(在绿线上我可以看到百分比为标签/文本)我收到此错误:“此样式的列不够”。

set xdata time
set timefmt '%Y/%m/%d'

set xtics 30*24*60*60
set datafile separator ','

set table 'temporaryfile.dat'
set format x '%Y/%m/%d'
plot 'updated.csv' using (timecolumn(1) - (tm_mday(timecolumn(1))-1)*24*60*60):(1) smooth frequency 
unset table

set y2tics 5
set ytics nomirror
set timefmt '"%Y/%m/%d"'
set format x '%b %Y'
set xtics rotate by 90 right
set format y2 "%g %%"

set grid ytics xtics
set y2range [0:100]
set ytics 10

set term png
set output 'file.png'
set terminal png size 2800,900

set datafile separator white
set yrange[0:*]
x0=x1=0
plot 'temporaryfile.dat' using 1:(strcol(3) eq "i" ? $2 : 1/0) w lp pt 7 ps 2 title 'IP/URL Count', \
     '' using 1:(x1=x0, x0=$2, strcol(3) eq "i" ? ($0 == 0 || x0 == 0 ? 0 : (x0-x1)/x0 * 100.0) : 1/0) axes x1y2 w labels

0 个答案:

没有答案