I'm trying to plot a heatmap with the RSSI of a wireless network using gnuplot. Up to now, I partially achieved that. I got the following picture, using the following code:

set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 1440, 900
set output "teste.png"
set size ratio -1
set xrange [ -0.5 : 3510.5 ]
set yrange [ -0.5 : 2480.5 ]
set noxtic
set noytic
r(x) = x >= 0.92 ? 0.0 / 7.0 : \
x >= 0.86 ? 1.0 / 7.0 : \
x >= 0.80 ? 2.0 / 7.0 : \
x >= 0.74 ? 3.0 / 7.0 : \
x >= 0.68 ? 4.0 / 7.0 : \
x >= 0.62 ? 5.0 / 7.0 : \
x >= 0.56 ? 6.0 / 7.0 : 7.0 / 7.0
g(x) = x >= 0.50 ? 1.0 : \
x >= 0.44 ? 6.0 / 7.0 : \
x >= 0.38 ? 5.0 / 7.0 : \
x >= 0.32 ? 4.0 / 7.0 : \
x >= 0.26 ? 3.0 / 7.0 : \
x >= 0.20 ? 2.0 / 7.0 : \
x >= 0.14 ? 1.0 / 7.0 : \
x == 0.00 ? 1.0 : 0.0
b(x) = x == 0.0 ? 1.0 : 0.0
set cbrange [ -99 : -49 ]
set cblabel "Intensidade (dBm)"
set cbtics -95, 3, -50
set palette function r(gray), g(gray), b(gray)
set colorbox horizontal user origin 0.7, 0.94 size 0.2, 0.01
plot "dados.dat" matrix title "Wireless A" with image
The graph is right, but I wanted to insert the place's plant as a background image. At first, I thought of using the multiplot feature, drawing the background image first and, on top of it, the heatmap. The problem with this is that I couldn't find any documentation on how to make the colors of the heatmap transparent and, as a result, the heatmap covers the background image completely.
Am I on the right track? If yes, how can I make the colors on the heatmap transparent, so that I can see both the background image and the heatmap? Or is there a better approach to solve this problem?
Thanks a lot.
with rgbalpha, but then you can't use a defined palette for the colors. But since you have defined your own functions for red, green and blue anyway, this is no problem. But that also means some fiddling with the color ranges and others to get the correct colorbox. To plot the background image first, you may use something likeplot 'bg.png' binary filetype=png w rgbimage, "dados.dat" using 1:2:(rsc($3)):(gsc($3)):(bsc($4)):(127) with rgbalpha.rscetc. is your functionr(x)with an adequate scaling. - Christoph