Colored contour plot / heat map
R
Example: Bivariate normal density (mean=(0,0), var-cov=diag(1,1))
```{r}
##R's heatmap function is NOT what i want
##I want a simple colored contour plot / heat map
library(mvtnorm) ##get multivariate normal functions
<- seq(-2,2,.01)
x <- cbind(rep(x,each=length(x)), rep(x, length(x)))
X <- matrix(dmvnorm(X), nrow=length(x))
z filled.contour(x=x,y=x,z=z, nlevels=100) ##take in vector x and y with matrix z of values
##See ?palettes for different color scheme
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=topo.colors)
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=heat.colors)
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=rainbow)
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=terrain.colors)
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=cm.colors)
##default
jpeg("ColoredContourHeatMap-MVN.jpeg")
filled.contour(x=x,y=x,z=z, nlevels=100, color.palette=terrain.colors)
dev.off()
```