Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to generate a heat map using gnu plot.

set title "Heat Map"

plot '-' matrix with image

10  20  30  40  50  60  70  80  90  100
20  30  40  50  60  70  80  90  100 0
30  40  50  60  70  80  90  100 0   0
40  50  60  70  80  90  100 0   0   0
50  60  70  80  90  100 0   0   0   0
60  70  80  90  100 0   0   0   0   0
70  80  90  100 0   0   0   0   0   0
80  90  100 0   0   0   0   0   0   0
90  100 0   0   0   0   0   0   0   0
100 0   0   0   0   0   0   0   0   0
e

Image generated

Along the axes I get values -2 0 2 4 6 8 10, and I would like to replace those with a custom string. I cannot find out how to do this.

share|improve this question

1 Answer 1

Try this solution:

set border 0 # remove box around map
set xtics ("first" 0, "sec." 2, "last" 9) # set special strings on selected position on x axes
set ytics ("first" 0, "sec." 2, "last" 9) # set special strings on selected position on y axes
unset key # without key

set title "Heat Map"
plot '-' matrix with image

10  20  30  40  50  60  70  80  90  100
20  30  40  50  60  70  80  90  100 0
30  40  50  60  70  80  90  100 0   0
40  50  60  70  80  90  100 0   0   0
50  60  70  80  90  100 0   0   0   0
60  70  80  90  100 0   0   0   0   0
70  80  90  100 0   0   0   0   0   0
80  90  100 0   0   0   0   0   0   0
90  100 0   0   0   0   0   0   0   0
100 0   0   0   0   0   0   0   0   0
e
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.