我们的图上除了标签之外,还有一个常用的标志:箭头。关于箭头的命令是 set arrow,语法和 label 有些类似,包括以下这些常用参数:
下面我们看例子,还是画 sinc(x) 函数: gnuplot> set term wxt font "DejaVu Sans,12" gnuplot> sinc(x) = sin(pi*x)/(pi*x) gnuplot> set xlabel "X" gnuplot> set ylabel "Y" gnuplot> set yrange [-0.4:1.2] gnuplot> set title "sinc(x) 函数" gnuplot> unset key gnuplot> set samples 500 gnuplot> set arrow 1 from 2,1.05 to 0.3,1 filled size 0.5,15,60 lw 2 gnuplot> set label 1 at 0,1 point pt 7 ps 1.5 lc rgb "#F87217" gnuplot> set label 2 "最大值在(0, 1)" at 2.1,1.05 gnuplot> plot sinc(x) lw 2 |
|
来自: icewater1234 > 《gnuplot》