用gnuplot绘制箭头 [英] Plotting arrows with gnuplot

查看:277
本文介绍了用gnuplot绘制箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在模拟中生成的数据.生成的数据文件如下所示:

I have data generated in a simulation. The generated data file looks something like this:

1990/01/01 99
1990/01/02 92.7
1990/01/03 100.3
1990/01/04 44.2
1990/01/05 71.23
...
2100/01/01 98.25

我可以通过简单地发出(加长版本的)命令来创建一个图表(简单):

I can create a chart (trivially), by simply issuing the (long versioned) command:

plot "simulation.dat" using 1:2 with line

我想添加第三列,它将添加箭头信息.第三列的编码如下:

I want to add a third column which will add arrow information. The encoding for the third column would be as follows:

  • 0 =>无需为该x轴值绘制箭头
  • 1 =>要为x轴值绘制一个向上的箭头
  • 2 =>要为x轴值绘制一个向下箭头

我才刚刚开始学习gnuplot,并且会很乐意帮助我如何使用gnuplot在第一个绘图上创建箭头?

I am just starting to learn gnuplot, and will appreciate help in how I can use gnuplot to create the arrows on the first plot?

推荐答案

我不认为有一种自动方法可以基于第三列同时创建所有箭头.您将需要对每个所需的箭头执行以下操作:

I dont think there is an automatic way to create all your arrows at the same time based on the third column. You will have to execute the following for each arrow that you want:

set arrow xval1,yval1 to xval2,yval2

您还可以使用相对箭头

set arrow xval1,yval1 rto 1,0

这将从xval1,yval1到(xval1 + 1),yval1绘制水平箭头

This will draw a horizontal arrow from xval1,yval1 to (xval1+1),yval1

与该集合相关的大量选项箭头命令:

这篇关于用gnuplot绘制箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆