title: Pretty ticks for log normal scale using ggplot2 (dynamic not manual)
body: <p>I am trying to use ggplot2 to create a performance chart with a log normal y scale. Unfortunately I'm not able to produce nice ticks as for the base plot function.</p>
  
  <p>Here my example:</p>
  
  <pre><code>library(ggplot2)
  library(scales)
  
  # fix RNG
  set.seed(seed = 1)
  
  # simulate returns
  y=rnorm(999, 0.02, 0.2)
  
  # M$Y are the cummulative returns (like an index)
  M = data.frame(X = 1:1000, Y=100)
  
  for (i in 2:1000)
    M[i, "Y"] = M[i-1, "Y"] * (1 + y[i-1])
  
  ggplot(M, aes(x = X, y = Y)) + geom_line() + scale_y_continuous(trans = log_trans())
  </code></pre>
  
  <p>produces ugly ticks:</p>
  
  <p><img src="https://i.stack.imgur.com/WPpHq.png" alt="enter image description here"></p>
  
  <p>I also tried:</p>
  
  <p><img src="https://i.stack.imgur.com/F26Xm.png" alt="enter image description here"></p>
  
  <pre><code>ggplot(M, aes(x = X, y = Y)) + geom_line() + 
    scale_y_continuous(trans = log_trans(), breaks = pretty_breaks())
  </code></pre>
  
  <p>How can I get the same breaks/ticks as in the default plot function:</p>
  
  <pre><code>plot(M, type = "l", log = "y")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/pP9kU.png" alt="enter image description here"></p>
  
  <p>The result should look like this but not with hard-typing the breaks but dynamic. I tried functions like <code>axisTicks()</code> but was not successful:</p>
  
  <pre><code>ggplot(M, aes(x = X,y = Y)) + geom_line() + 
    scale_y_continuous(trans = log_trans(), breaks = c(1, 10, 100, 10000))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/scVlB.png" alt="enter image description here"></p>
  
  <p>Thanks!</p>
  
  <p>edit: inserted pictures</p>