title: Generating heat maps in R with ordered columns & rows
body: <p>I would like to generate a heat map using an ordered 6x6 matrix. This is the code I have used:</p>
  
  <pre><code>mat_data &lt;- data.matrix(data[,2:ncol(data)])  # transform column 2-7 into a matrix
  rownames (data) &lt;- c("1","2","3","4", "5", "6")
  colnames (data) &lt;- c("1","2","3","4", "5", "6")
  
  png("..../trial.png",    # create PNG for the heat map        
  width = 5*300,        # 5 x 300 pixels
  height = 5*300,
  res = 300,            # 300 pixels per inch
  pointsize = 8)        # smaller font size
  
  heatmap.2(mat_data, 
      cellnote = mat_data,  # same data set for cell labels
      main = "Trial",       # heat map title
      notecol="black",      # change font color of cell labels to black
      density.info="none",  # turns off density plot inside color legend
      trace="none",         # turns off trace lines inside the heat map
      margins =c(8,9),      # widens margins around plot
      col=my_palette,       # use on color palette defined earlier 
      dendrogram="none",    # no dendrogram
      Rowv = "FALSE",
      Colv="FALSE")         # turn off column clustering
  
  dev.off()                 # close the PNG device
  </code></pre>
  
  <p>I want the rows ordered 1-6 across, and columns ordered 6-1 from top to bottom starting at the lower left hand box, such that the map is paired 1-1 at (row, column) (6,1), 2-1 at (6,2), 3-1 at (6,3)...etc </p>
  
  <p>Kindly assist on how to change the order, thanks.</p>