plot vertical line with gnuplot

  The vertical line can be plotted with gnuplot with vector.
plotvector.sh

#! /bin/sh  
file_in=data.txt 
gnuplot<<!
set xlabel "n" 
set ylabel "time/s"
set xrange [0:5]
set yrange [0:10]
set label 1 "arrowstyle 1:" at -520, -100, 0 right norotate back nopoint
set label 2 "arrowstyle 2:" at -520, -110, 0 right norotate back nopoint
set label 3 "arrowstyle 3:" at -520, -120, 0 right norotate back nopoint
set label 4 "arrowstyle 4:" at -520, -130, 0 right norotate back nopoint
set label 5 "arrowstyle 5:" at -520, -140, 0 right norotate back nopoint
set label 6 "arrowstyle 6:" at -520, -150, 0 right norotate back nopoint
set label 7 "arrowstyle 7:" at -520, -160, 0 right norotate back nopoint
set label 8 "arrowstyle 8:" at -520, -170, 0 right norotate back nopoint
set arrow 1 from -500, -100, 0 to 500, -100, 0  back filled linetype 1 linewidth 2.000 size screen 0.025,30.000,45.000
set arrow 2 from -500, -110, 0 to 500, -110, 0  back nofilled linetype 3 linewidth 2.000 size screen 0.030,15.000,90.000
set arrow 3 from -500, -120, 0 to 500, -120, 0  back filled linetype 1 linewidth 2.000 size screen 0.030,15.000,45.000
set arrow 4 from -500, -130, 0 to 500, -130, 0  back filled linetype 3 linewidth 2.000 size screen 0.030,15.000,90.000
set arrow 5 from -500, -140, 0 to 500, -140, 0  back filled linetype 1 linewidth 2.000 size screen 0.030,15.000,135.000
set arrow 6 from -500, -150, 0 to 500, -150, 0  back empty linetype 3 linewidth 2.000 size screen 0.030,15.000,135.000
set arrow 7 from -500, -160, 0 to 500, -160, 0  nohead back nofilled linetype 1 linewidth 2.000
set arrow 8 from -500, -170, 0 to 500, -170, 0  back nofilled linetype 3 linewidth 2.000 size screen 0.008,90.000,90.000
set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize 1.000
set style line 2 linetype 3 linewidth 2.000 pointtype 2 pointsize 1.000
set style arrow 1  back filled linetype 1 linewidth 2.000 size screen 0.025,30.000,45.000
set style arrow 2  back nofilled linetype 3 linewidth 2.000 size screen 0.030,15.000,90.000
set style arrow 3  back filled linetype 1 linewidth 2.000 size screen 0.030,15.000,45.000
set style arrow 4  back filled linetype 3 linewidth 2.000 size screen 0.030,15.000,90.000
set style arrow 5  back filled linetype 1 linewidth 2.000 size screen 0.030,15.000,135.000
set style arrow 6  back empty linetype 3 linewidth 2.000 size screen 0.030,15.000,135.000
set style arrow 7  nohead back nofilled linetype 1 linewidth 2.000
set style arrow 8  back nofilled linetype 3 linewidth 2.000 size screen 0.008,90.000,90.000
set term "pdf"
set output "test.pdf"
plot "${file_in}" u 1:2:3:4 title "rtt1" with vectors arrowstyle 7
set output
exit
!

 u 1:2:3:4 means x,y,x+Δx,y+Δy x , y , x + Δ x , y + Δ y .
 the data.txt I use in plot

1   2   0   1
1   5   0   1
2   3   1   2

 Of course, the arrow style cam be configured: plot “${file_in}” u 1:2:3:4 title “rtt1” with vectors arrowstyle 7.Result:
这里写图片描述
  The array style of 5:plot “${file_in}” u 1:2:3:4 title “rtt1” with vectors arrowstyle 5. Results:
这里写图片描述
Reference
[1]gnuplot demo script

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值