title: plot a heatmap with a third dimension
body: <p>I would like to plot a heatmap like this</p>
  
  <p><img src="https://i.stack.imgur.com/YtvfJ.png" alt="enter image description here"></p>
  
  <p>I know how to do a normal heatmap in R but am unsure how the 3D component can be introduced. I thought about just using a 3d bar chart but then I am not sure how to conditionally set the bar colour. Can somebody recommend a tool to do something like this?
  Another example would be <a href="http://learnr.files.wordpress.com/2009/07/chapter06-06_15_l.png" rel="nofollow noreferrer">here</a></p>
  
  <p>but there it is not coloured according to the heatmap colours.</p>
  
  <p>This might go also by the name of 3D histogram. Is there a way to produce such a figure in R (where the hight of the boxes is given by 1 variable and the colour formatting indicated by another ?) like <a href="https://stackoverflow.com/questions/17756925/how-to-plot-heatmap-colors-in-3d-in-matplotlib">here</a> </p>
  
  <p>My problem with JTT solution is that I would need to be able to colour the 3D Bars independently of the VA Deaths variable. I have a 2D heatmap (which do already set the colours for each 3D bar). The height of the bar is then set by another variable. This means the colour is not related to the height.</p>