Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .