title: Mark tiles in logarithmic geom_raster
body: <p>I have seen <a href="https://stackoverflow.com/questions/13258454/marking-specific-tiles-in-geom-tile-geom-raster">this post</a>, but I'm struggling to translate that to a logarithmic raster.</p>
  
  <p>For example:</p>
  
  <pre><code>library(tidyverse)
  a &lt;- tibble(x = rep(10^seq(-2, 2), 5), 
              y = rep(10^seq(-2, 2), each = 5),
              z = runif(25))
  
  a %&gt;%
    ggplot(aes(x, y)) +
    geom_raster(aes(fill = z)) +
    scale_x_log10() +
    scale_y_log10()
  </code></pre>
  
  <p>How do I now get for example a box around the row with <code>y = 0.1</code>? Or a box around just one tile?</p>
  
  <p>I know that the half-point between two points on a logarithmic scale is calculated by the geometric mean.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>For the example above, the solution seems to work but not if <code>x</code> and <code>y</code> look a little different, e.g.:</p>
  
  <pre><code>n_x &lt;- 10^seq(log10(6), log10(24*365), by = 0.1)/365
  n_y &lt;- 10^seq(-1, 3, by = 0.1)
  
  a &lt;- tibble(x = rep(n_x, length(n_y)), 
              y = rep(n_y, each = length(n_x)),
              z = runif(length(n_x)*length(n_y)))
  
  h &lt;- a$y[which.min(abs(a$y - 1.14*24))]
  
  h.tb &lt;- a %&gt;%
    dplyr::filter(y == h)
  
  a %&gt;%
    ggplot(aes(x = x, y = y)) +
    geom_raster(aes(fill = z)) +
    scale_x_log10() +
    scale_y_log10(breaks = c(1, h, 100), labels = c('1', 'h', '100')) +
    geom_tile(data = h.tb, fill = NA, colour = "black", size = 2)  
  </code></pre>
  
  <p>Interestingly, <code>h.tb</code> contains the correct data.</p>