分享

Gnuplot (七) 箭头

 icewater1234 2014-08-20

本文大部分摘录于瞬间集博客:http://blog.sciencenet.cn/u/yusufma

我们的图上除了标签之外,还有一个常用的标志:箭头。关于箭头的命令是 set arrow,语法和 label 有些类似,包括以下这些常用参数:
  • from ... to ...
    箭头的起点和终点坐标。如果把 to 换成 rto,第二个坐标就表示相对位置而不是绝对坐标。
  • nohead, head, backhead, heads
    分别表示:没有箭头(其实就是线段),箭头在终点,箭头在起点,双向都有箭头。
  • size <length>,<angle>,<backangle>
    箭头尺寸,默认长度单位为 first 坐标单位长度。
    下图中 A,B,C 分别代表 <length><angle><backangle>
  • filled, empty, nofilled
    箭头的三种填充风格:

下面我们看例子,还是画 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




    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多