Gnuplot、风强度和方向图

Gnuplot、风强度和方向图,gnuplot,Gnuplot,我来找你是想了解如何修改我的脚本。我想在图3上绘制信息: 风速、灰尘速度和风向 我发现风向的方法是用矢量来做,但也许有不同的方法,我是开放的 我的数据是这样的 #Year Temp Wind speed Origine of the win Dust Cos Sin 2019-02-28-09:0 9.7 11 0 21.6 3.141592654 -1 1.22515E-16

我来找你是想了解如何修改我的脚本。我想在图3上绘制信息:

风速、灰尘速度和风向

我发现风向的方法是用矢量来做,但也许有不同的方法,我是开放的

我的数据是这样的

#Year   Temp    Wind speed  Origine of the win  Dust        Cos Sin                                     
2019-02-28-09:0 9.7 11  0   21.6    3.141592654 -1  1.22515E-16                                                                                                             
2019-02-28-10:0 10.6    25  45  46.8    3.926990817 -0.707106781    -0.707106781                                                                                                                
2019-02-28-11:0 12.5    18  90  36  4.71238898  -1.83772E-16    -1                                                                                                              
2019-02-28-12:0 13.2    29  260 43.2    7.679448709 0.173648178 0.984807753                                                                                                             
2019-02-28-13:0 13.2    29  90  43.2    4.71238898  -1.83772E-16    -1                                                                                                              
2019-02-28-14:0 13.2    29  90  43.2    4.71238898  -1.83772E-16    -1                                                                                                              
2019-02-28-15:0 13.2    29  260 43.2    7.679448709 0.173648178 0.984807753                                                                                                             
2019-02-28-16:0 13.2    29  90  43.2    4.71238898  -1.83772E-16    -1                                                                                                              
2019-02-28-17:0 13.2    29  45  43.2    3.926990817 -0.707106781    -0.707106781                                                                                                                
2019-02-28-18:0 13.2    29  90  43.2    4.71238898  -1.83772E-16    -1                                                                                                              
我的剧本是

# Setting xdata to time.
#set xdata time
#set timefmt "%Y-%m-%d-%H:%M"

# set format x controls the way that gnuplot displays the dates on the x axis.
# "%Y-%m-%d" is the same as "%F", but "%F" applies to output only; it won't work
# for timefmt, which controls data reading.
#set format x "%H:%M"

#set xrange ["2019-02-28-06:00":"2019-02-28-18:00"]
set yrange [0:]

FILE="Donnees.txt"
#unset polar
set angles degrees
#set angles polar
set border 3
set grid mxtics mytics xtics ytics 
set ytics nomirror
set xtics nomirror
set key outside  bmargin left spacing 1.8
set key maxrows 1
set ylabel 'Vitesse [Km/s]'
set xlabel 'Temps [hh:mm]'
#set title "Conditons Meteo" 
set title  font "Arial,14" norotate


#set style arrow 1 head fixed filled size screen 0.03,15,120 ls 1

plot FILE using 0:3 with lines          # just to get the scaling
#SCALE = (GPVAL_X_MAX - GPVAL_X_MIN) / (2*(GPVAL_Y_MAX - GPVAL_Y_MIN))
#SCALE = (GPVAL_X_MAX - GPVAL_X_MIN) / ((GPVAL_Y_MAX - GPVAL_Y_MIN)) * (GPVAL_TERM_YMAX - GPVAL_TERM_YMIN) / (GPVAL_TERM_XMAX - GPVAL_TERM_XMIN) * GPVAL_TERM_XSIZE / GPVAL_TERM_YSIZE

LEN=0.001*SCALE
LEN= 2

dx(x) = LEN*x
dy(x) = LEN*x

plot \
    FILE using 0:3:((cos($4))*LEN):((sin($4))*LEN) with vectors fixed filled lc 1 lt 1  title"Origine" ,\
    FILE using 0:3:(dx($7)):(dy($8)) with vectors fixed filled lc 2 lt 2  title"Directions" ,\
    FILE using 0:3 smooth csplines  title "Vitesse",\
    FILE using 0:5 smooth csplines t "Rafale"
如果我不用时间画gaph,我不知道如何固定向量的相同长度,当我用时间画gaph时。。。它坏了向量的长度是值得的,我失去了正确的向量方向


我已经在很多地方看过了,但我想不出来,有人能帮我吗

x和y上的比例不匹配是
“带向量”打印样式的问题

使用gnuplot 5.2我没有一个好的答案

在gnuplot 5.3(开发版本)中,有一种新的绘图样式
“带箭头”
,类似于
“带矢量”
,不同之处在于箭头是通过长度和角度而不是dx和dy来描述的

我不理解示例数据中第4列和第6列的值的含义,因此我可能构造了错误的长度,但是下面对脚本的修改说明了如何为每个箭头使用固定长度或列值

set xdata time
set timefmt "%Y-%m-%d-%H:%M"

# set format x controls the way that gnuplot displays the dates on the x axis.
# "%Y-%m-%d" is the same as "%F", but "%F" applies to output only; it won't work
# for timefmt, which controls data reading.
set format x "%H:%M"

set xrange ["2019-02-28-06:00":"2019-02-28-18:00"]
set yrange [0:]

set border 3
set grid mxtics mytics xtics ytics 
set ytics nomirror
set xtics nomirror
set key bottom center outside spacing 1.8
set key maxrows 1
set ylabel 'Vitesse [Km/s]'
set xlabel 'Temps [hh:mm]'
set title  font "Arial,14" norotate


set style arrow 1 head fixed filled
set ang degree
SCALE = 360.        # length unit equivalent to 10 minutes on x

plot \
    FILE using 1:3:(2.*SCALE):4 with arrows as 1 title "fixed length" ,\
    FILE using 1:5:($6*SCALE):(atan2($7,$8)) with arrows as 1 title "len = column 6" ,\
    FILE using 1:3 smooth csplines  title "Vitesse",\
    FILE using 1:5 smooth csplines t "Rafale"

感谢您的回复和“带arows”的提示。 柱原点是风的方向,单位为度。我需要应用一个修正来获得方向

为“灰尘”感到抱歉,这是阵风。。。。错误 太棒了,你的箭太棒了。 这真的很好,我将使用5.3版本。明天,我将尝试找到一种方法来制作一个刻度,即使我减少或扩大显示的小时数,也能给出相同大小的箭头。将5小时的图形与12小时的图形具有相同的箭头。 让我试着提出一个解决方案,或者不


谢谢

一个问题,我在哪里可以找到5.3版本测试版的编译版本,或者我需要编译源代码?它可以完美地使用SCALE=1.*((GPVAL_X_MAX-GPVAL_X_MIN)/(GPVAL_Y_MAX-GPVAL_Y_MIN))谢谢