Вопрос

I want to produce a heat map that on one hand contains special points that do not lay in the heat range and on the other hand has points that have a number written on them. I managed to put something over the map, but just a red cross and no number.

result

I used the code:

set title "Heat Map"
set cblabel "Compactness"
set terminal pngcairo size 1500,500
set output "heatmap.png"
set autoscale fix
set size ratio -1
set cbrange [0:148.02038835341716]
set palette defined (-1 "black", 0 "#5614FF", 20 "#9616FF", 50 "#FF51AB", 70 "#FFB54F", 90 "#FFF76D", 100 "white", 101 "#353535")

plot  '-' matrix with image,\
      'numbers.txt' u 1:2

with the numbers.txt containing:

1 2 "1"
3 1 "2"

for testing.

So 1st instead of the red x I would want "1" or "2" to be print on the cell.

2nd I would also be interested in how to change the color of the text then.

And 3rd: in the right top corner I'd like the text 'numbers.txt 1:2 and the red cross to disappear.

Any suggestions are welcome!

Это было полезно?

Решение

You can use the labels plotting style for this:

plot '-' matrix with image, 'numbers.txt' u 1:2:3 with labels 

After the with labels you can use any formatting specifier which you can also use for labels:

plot '-' matrix with image, 'numbers.txt' u 1:2:3 with labels textcolor rgb 'red' font ',16'

To remove the legend use unset key.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top