Printing heatmaps to file