gnuplot矩阵或绘图:显示颜色和点值 [英] gnuplot matrix or plot : display both color and point value

查看:2929
本文介绍了gnuplot矩阵或绘图:显示颜色和点值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gnuplot来分析数据。



我经常使用调色板和矩阵。



但是每当我使用它,精度总是问题。



如果我通过定义许多颜色增加精度,很难记住和阅读。



如果我减少颜色的数量来清除比较,精度会下降。



所以我在想象矩阵与图号。



如果我可以显示颜色和数字,它将更容易看到和分析。



至少我想显示数字,(只使用excel是一个选择,但我不要)



或显示不同颜色的数字(由点值决定的颜色)

如果您知道该怎么办,请让我知道。



如果您不明白,请告诉我。



提前感谢,

解决方案

要绘制标签,只需使用 绘图风格。您可以使用任何字符串和字符串格式,例如用 sprintf 设置标签:

  reset 
autoscale fix
set palette defined(0'white',1'green')
set tics scale 0
unset cbtics
set cblabel'Score'
unset key
plot'data.txt'matrix with image,\
''matrix using 1:2:(sprintf('%。2f',$ 3))with labels font',16'



pngcairo 终端和gnuplot 4.6.3的结果:



>



此示例的数据文件 data.txt 为:

  0.22 0.13 0.54 0.83 0.08 
0.98 0.57 0.52 0.24 0.66
0.23 0.68 0.24 0.89 0.76
0.89 0.78 0.69 0.78 0.10
0.24 0.77 0.27 0.28 0.69


I'm using gnuplot to analysis data.

And I frequently use palette and matrix.

However whenever I use that, precision is always problem.

If I increase precision by define many color, it is difficult to remember and to read.

If I decrease number of color to clear comparison, precision become decrease.

So I'm thinking matrix with plot number.

If I can display both color and number, it will be more easy to see and analysis.

At least I want display only number,(Just use excel is a one choice but I don't want to)

or display number with different color.(color determined by point value)

If you know the way to do, please let me know.

If you can't understand, please tell me.

Thank you in advance,

解决方案

To plot the labels, just use the with labels plotting style. You can use any string and string formatting e.g. with sprintf to set the label:

reset
set autoscale fix
set palette defined (0 'white', 1 'green')
set tics scale 0
unset cbtics
set cblabel 'Score'
unset key
plot 'data.txt' matrix with image,\
     '' matrix using 1:2:(sprintf('%.2f', $3)) with labels font ',16'

The result with the pngcairo terminal and gnuplot 4.6.3 is:

The data file data.txt for this example is:

0.22 0.13 0.54 0.83 0.08
0.98 0.57 0.52 0.24 0.66
0.23 0.68 0.24 0.89 0.76
0.89 0.78 0.69 0.78 0.10
0.24 0.77 0.27 0.28 0.69

这篇关于gnuplot矩阵或绘图:显示颜色和点值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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