试图绘制风玫瑰图1。这是当前版本:
set terminal pngcairo size 800,800
set output 'colors.png'
set palette model RGB defined ( 0 '#e3f2fd', 1 '#bbdefb', 3 '#90caf9', 4 '#64b5f6', 5 '#42a5f5', 6 '#2196f3', 7 '#1e88e5', 8 '#1976d2', 9 '#1565c0', 10 '#0d47a1')
set polar
set size square
set grid polar front
set angles degrees
set grid polar 11.25
set grid ls 2
set rrange [0:25]
set_label(x, text) = sprintf("set label '%s' at (22*cos(%f)), (22*sin(%f)) center", text, x, x) #this places a label on the outside
#here all labels are created
eval set_label(0, "E")
eval set_label(22.5, "ENE")
eval set_label(45, "NE")
eval set_label(67.5, "NNE")
eval set_label(90, "N")
eval set_label(112.5, "NNW")
eval set_label(135, "NW")
eval set_label(157.5, "WNW")
eval set_label(180, "W")
eval set_label(202.5, "WSW")
eval set_label(225, "SW")
eval set_label(247.5, "SSW")
eval set_label(270, "S")
eval set_label(292.5, "SSE")
eval set_label(315, "SE")
eval set_label(337.5, "ESE")
unset xtics
unset ytics
set border 0
plot for [i=-11.25:11.25] 'wind.data' u (22.5*0+i):(($5>0)?$1:''):($5) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*1+i):(($4>0)?$1:''):($4) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*2+i):(($3>0)?$1:''):($3) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*3+i):(($2>0)?$1:''):($2) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*4+i):(($17>0)?$1:''):($17) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*5+i):(($16>0)?$1:''):($16) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*6+i):(($15>0)?$1:''):($15) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*7+i):(($14>0)?$1:''):($14) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*8+i):(($13>0)?$1:''):($13) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*9+i):(($12>0)?$1:''):($12) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*10+i):(($11>0)?$1:''):($11) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*11+i):(($10>0)?$1:''):($10) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*12+i):(($9>0)?$1:''):($9) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*13+i):(($8>0)?$1:''):($8) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*14+i):(($7>0)?$1:''):($7) w p pt 5 ps 2 palette notitle,\
for [i=-11.25:11.25] '' u (22.5*15+i):(($6>0)?$1:''):($6) w p pt 5 ps 2 palette notitle
' wind.data'包含第一列 - 速度(1,2,3,4等m / s)和每个方向的列(即角度)。通过'看到我可怕的解决方案。循环来绘制一种扇形。那么,我问是否有更好的选择?如何绘制扇区/段?
当前输出: