I think the problem is the wrong call to the sprintf function.
sprintf(format,values)
You should call sprintf with a decimal number in format (%d
) and the label value you want to display (third column $3
) :
sprintf("%d",$3)
I copied your data into a file (named data
) and this example works well :
plot 'data' matrix using 1:2:3 with image, '' matrix using 1:2:($3==0 ? " " : sprintf("%d",$3)) with labels
Hope it helps!