I have been grappling with visualizing two dimensional histograms of posterior density distributions of parameters, as estimated by one of your favorite programs – IMa2, MIGRATE-n, MSVAR, etc. All these programs print out distributions of estimated parameters, and here’s a neat and innovative way to visualize them in two dimensions. As an example, I used the output of MSVAR v.1.3 for some simulated microsatellite data with a bottleneck – that can be accessed at this link. A little Googling led me to this great post on five different ways to build two dimensional histograms in R – I use the hexbinplot() function here to obtain my plots. Feel free to play around with the other methods, and program outputs!
install.packages(“hexbin”) install.packages(“RColorBrewer”) library(hexbin) library(RColorBrewer) rf <- colorRampPalette(rev(brewer.pal(11,'Spectral'))) r <- rf(32) hpars<-read.table("hpars.dat") hexbinplot(V6~V4,data=hpars,xlab="Log10(Current population size N0)", ylab="Log10(Past population size Na)",colramp=rf)
And voila! Simple, yet fun and intuitive visualization of densities!