Gnuplot matrix or plot: display both color and point value

I use gnuplot for data analysis.

And I often use the palette and matrix.

However, whenever I use this, accuracy is always a problem.

If I increase accuracy by setting many colors, it is difficult to remember and read.

If I reduce the number of colors to clear the comparison, accuracy will decrease.

So, I think the matrix with the plot number. example of matrix

If I can display both color and number, it will be easier to see and analyze.

At least I only want the display number (just use excel - this is one choice, but I don't want to)

or display number with a different color (the color is determined by the point value)

If you know how to do this, please let me know.

If you cannot understand, please tell me.

Thank you in advance,

+6
source share
1 answer

To build labels, simply use the build style with labels . You can use any string and string formatting, for example. using sprintf 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' 

Result with terminal pngcairo and gnuplot 4.6.3:

enter image description here

The data.txt data file for this example:

 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 
+6
source

Source: https://habr.com/ru/post/953864/


All Articles