title: Don't want to display all labels for minor ticks from ggplot2
body: <p>I searched and found a similar post in Python not R.  I am using Richie Cotton's code in this post <a href="https://stackoverflow.com/questions/5821763/logarithmic-y-axis-tick-marks-in-r-plot-or-ggplot2">Logarithmic y-axis Tick Marks in R plot() or ggplot2()</a>. I don't want to display all labels for minor ticks, I only want to display major ticks such as 1, 10, 100 etc.  Please see an exampled image below, that's why I don't want to display all minor tick's labels. I tried to remove "labels=breaks"<a href="https://i.stack.imgur.com/eJoU7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eJoU7.png" alt="enter image description here"></a> in the code, but nothing happened. </p>
  
  <pre><code>library(ggplot2)
  
  dfr &lt;- data.frame(x = 1:100, y = rlnorm(100))
  
  p &lt;- ggplot(dfr, aes(x, y)) + 
    geom_point() +
    scale_x_log10(breaks = breaks, labels = breaks)
  
  get_breaks &lt;- function(x){
    lo &lt;- floor(log10(min(x, na.rm = TRUE)))
    hi &lt;- ceiling(log10(max(x, na.rm = TRUE)))
    as.vector(10 ^ (lo:hi) %o% 1:9)
  }
  
  breaks &lt;- get_breaks(dfr$x)
  
  log10_breaks &lt;- log10(breaks)
  
  p + labs(axis.ticks = element_line(
    size = ifelse(log10_breaks == floor(log10_breaks), 2, 1)
    ))
  </code></pre>