I have a predefined set of coordinates, \where, and a corresponding value, \value. Each coordinate covers an rectangle. I like to choose the color of the fill=...option based on the value. The result is a heatmap - but plot outside of pgfplot.
I've seen that pgfplot can plot heatmaps, however, I need to plot the map over an existing figure. Although, the colormap/jet of pgfplot plot seams really nice. Thus if possible, I like to have a function that picks a color colormap/jet. I will also need a bar (color , corresponding value).
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
%existing figure
\draw (0,1) circle (1);
\draw (1,2) circle (.7);
%heatmap
\foreach \where/\value in
{ (0,0)/0.5,(1,0)/0.3,(2,0)/0.1, %coordinates and values between 0 and 1
(0,1)/0.3,(1,1)/0.2,(2,1)/0.05,
(0,2)/0.1,(1,2)/0.4,(2,2)/0.2%
}
{ \path [overlay] \where coordinate (A);
\draw [fill=orange, , opacity=0.2] ($(A)-(.5,.5)$) rectangle ($(A)+(.5,.5)$); } %fill with the correct color
%add a color bar
\end{tikzpicture}
\end{document}





outer coloramd changeinner colortofill. – Tom Bombadil Dec 23 '15 at 12:07