gnuplot:如何在热图图中写入z值 [英] Gnuplot: how to write the z values in a heatmap plot

查看:187
本文介绍了gnuplot:如何在热图图中写入z值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Gnuplot 4.6.5

I am using Gnuplot 4.6.5

我想在热图图中写出z值.

I want to write the z value in a heatmap plot.

以下是生成热图的代码:

Here is the code for producing the heatmap:

#
# Two ways of generating a 2D heat map from ascii data
#

set title "Heat Map generated from a file containing Z values only"
unset key
set tic scale 0

# Color runs from white to green
set palette rgbformula -7,2,-7
set cbrange [0:5]
set cblabel "Score"
unset cbtics

set xrange [-0.5:1.5]
set yrange [-0.5:1.5]

set view map
plot '-' using 1:2:3 with image
0 0 5
0 1 4

1 0 2
1 1 2
e

这给出了:

我想在图中写出z值:

我的实际数据比这里使用的演示数据大得多.因此,手动编写每个点几乎是不切实际的.

My actually data is much larger than the demonstration data used here. So it is almost impractical to write each point manually.

任何帮助将不胜感激.

推荐答案

您可以为此使用labels绘图样式.另请参见 gnuplot矩阵或绘图:同时显示颜色和点值,这是一个非常相似的问题:

You can use the labels plotting style for this. See also gnuplot matrix or plot : display both color and point value for a very similar question:

unset key
set palette rgbformula -7,2,-7
set cbrange [0:5]
set cblabel "Score"
unset cbtics
set autoscale fix

plot '-' using 1:2:3 with image, \
     '-' using 1:2:(strcol(3)) with labels
0 0 5
0 1 4

1 0 2
1 1 2
e
0 0 5
0 1 4

1 0 2
1 1 2
e

这篇关于gnuplot:如何在热图图中写入z值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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