title: Ordering x-axis on correlation heat map using ggplot
body: <p>I am trying to create a correlation heat map using ggplot, but I cannot seem to control the order of my variables on the x or y axis.  Specifally, ggplot seems to try to order the variables sequentially, but only operating on the first digit.  Here's a simple example of the problem</p>
  
  <pre><code>x1&lt;-c(1,2,3,4,5,6,6,7,4,5,6,3,4,5,6,7,8,9)
  
  x2&lt;-c(1,2,3,3,5,4,6,7,4,4,6,3,4,5,6,10,8,9)
  
  x3&lt;-c(2,2,3,5,5,4,6,4,4,4,6,3,4,5,6,10,8,9)
  
  x4&lt;-c(1,2,3,5,5,4,6,4,4,4,4,4,4,5,6,10,8,9)
  
  x5&lt;-c(1,2,3,3,5,4,6,7,4,4,6,3,4,5,6,10,8,9)
  
  x10&lt;-c(1,1,1,1,1,1,6,1,1,1,1,1,4,5,1,1,1,1)
  
  new=data.frame(x1)
  
  new$x2=x2
  
  new$x3=x3
  
  new$x4=x4
  
  new$x5=x5
  
  new$x10=x10
  
  keep=melt(cor(new))
  
  ggplot(keep,aes(Var1,Var2),xlab=NULL,ylab=NULL) + geom_tile(aes(fill = value),colour = "white") + scale_fill_gradient(low = "white",high = "steelblue")+theme(axis.title.x=element_blank(),axis.title.y=element_blank())
  </code></pre>
  
  <p>If you run this code you'll see that the x-axis is ordered  </p>
  
  <pre><code>x1, x10, x2, x3, x4, x5 
  </code></pre>
  
  <p>whereas I want it to read</p>
  
  <pre><code>x1, x2, x3, x4, x5, x10
  </code></pre>
  
  <p>Is there a way to specify this order?</p>