gnuplot:如何绘制每个月温度的颜色平方?
我想绘制以下图(来自)使用GNUPLOT:
我希望每个位置的数据类似:
# month temperature
01 60.0
02 78.0
03 90.0
...
12 78.0
这是我尝试的。为简单起见,我将数据转移到矩阵中。
$data << EOD
1.50 1.57 1.85 2.15 1.87 1.05 1.70 1.65 1.97 1.71 1.53 1.15
4.44 4.71 4.74 3.50 3.43 4.98 4.29 4.55 3.93 3.34 3.74 4.88
8.55 9.59 5.65 0.13 9.33 4.70 8.94 7.74 4.49 6.26 0.96 1.20
EOD
unset border
unset ytics
set xlabel 'month'
set palette rgbformula -7,2,-7
set cbrange [0:10]
set cblabel "precipitation"
set xrange [-0.5:11.5]
set yrange [-0.5:2.5]
set xtics ("Jan" 0, "Feb" 1, "Mar" 2, "Apr" 3, "May" 4, \
"Jun" 5, "Jul" 6, "Aug" 7, "Sep" 8, "Oct" 9, "Nov" 10, "Dec" 11)
plot $data matrix with image
但是效果远非令人满意。例如,如何在正方形之间产生清晰的边界?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
带有图像的绘图样式
可能没有边界。因此,我将使用boxxyerror
使用多功能样式。
此外,代替矩阵格式,我会添加一个线标头并循环通过列(因为总会有12个月)
检查以下示例以及
帮助BoxXyError
,帮助大小
,帮助Xticlabels
和help strftime
以获取进一步的阅读。如果您在单独的文件中有数据,则必须相应地修改脚本。
脚本:
结果:
The plotting style
with image
probably cannot have borders. So, I would use the versatile stylewith boxxyerror
.Furthermore, instead of matrix format I would add a line header and loop through the columns (since there will be always 12 months)
Check the following example as well as
help boxxyerror
,help size
,help xticlabels
andhelp strftime
for further reading.If you have your data in separate files you would have to modify the script accordingly.
Script:
Result: