title: Change axis labels of a modified ggpairs plot (heatmap of correlation)
body: <p>I wanted to combine a <code>ggpairs</code> plot with a heatmap and found a wonderful solution:
  <a href="https://stackoverflow.com/questions/45873483/ggpairs-plot-with-heatmap-of-correlation-">ggpairs plot with heatmap of correlation values</a></p>
  
  <pre><code>#library
  library(GGally)
  library(ggplot2)
  
  #data
  sample_df &lt;- data.frame(replicate(7,sample(0:5000,100)))
  colnames(sample_df) &lt;- c("KUM", "MHP", "WEB", "OSH", "JAC", "WSW", "gaugings")
  
  #function for heatmap
  my_fn &lt;- function(data, mapping, method="p", use="pairwise", ...){
  
            # grab data
            x &lt;- eval_data_col(data, mapping$x)
            y &lt;- eval_data_col(data, mapping$y)
  
            # calculate correlation
            corr &lt;- cor(x, y, method=method, use=use)
  
            # calculate colour based on correlation value
            # Here I have set a correlation of minus one to blue, 
            # zero to white, and one to red 
            # Change this to suit: possibly extend to add as an argument of `my_fn`
            colFn &lt;- colorRampPalette(c("blue", "white", "red"), interpolate ='spline')
            fill &lt;- colFn(100)[findInterval(corr, seq(-1, 1, length=100))]
  
            ggally_cor(data = data, mapping = mapping, ...) + 
              theme_void() +
              theme(panel.background = element_rect(fill=fill))
          }
  
  #combine
  ggpairs(sample_df, 
                     upper = list(continuous = my_fn),
                     lower = list(continuous = "smooth"))
  </code></pre>
  
  <p>Because the axis labels do not fit in my real data, I would like to change them (angle) and I found this solution:</p>
  
  <p><a href="https://stackoverflow.com/questions/46864196/ggpairs-rotate-axis-label">ggpairs rotate axis label</a></p>
  
  <p>However, If I add it, I lose the heatmap</p>
  
  <pre><code>ggpairs(sample_df,
          upper = list(continuous = my_fn),
          lower = list(continuous = "smooth")) +
          theme(axis.text.x = element_text(angle = 90, hjust = 1, size=8))
  </code></pre>
  
  <p>I also tried to add the theme to the <code>my_fn</code>, without success. </p>