title: Transform only one axis to log10 scale with ggplot2
body: <p>I have the following problem: I would like to visualize a discrete and a continuous variable on a boxplot in which the latter has a few extreme high values. This makes the boxplot meaningless (the points and even the "body" of the chart is too small), that is why I would like to show this on a log10 scale. I am aware that I could leave out the extreme values from the visualization, but I am not intended to.</p>
  
  <p>Let's see a simple example with diamonds data:</p>
  
  <pre><code>m &lt;- ggplot(diamonds, aes(y = price, x = color))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/aK2Ro.png" alt="alt text"></p>
  
  <p>The problem is not serious here, but I hope you could imagine why I would like to see the values at a log10 scale. Let's try it:</p>
  
  <pre><code>m + geom_boxplot() + coord_trans(y = "log10")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ifWhk.png" alt="alt text"></p>
  
  <p>As you can see the y axis is log10 scaled and looks fine but there is a problem with the x axis, which makes the plot very strange.</p>
  
  <p>The problem do not occur with <code>scale_log</code>, but <em>this is not an option for me</em>, as I cannot use a custom formatter this way. E.g.:</p>
  
  <pre><code>m + geom_boxplot() + scale_y_log10() 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/SUdX5.png" alt="alt text"></p>
  
  <p>My question: does anyone know a solution to plot the boxplot with log10 scale on y axis which labels could be freely formatted with a <code>formatter</code> function like in this <a href="https://stackoverflow.com/q/4646020/564164">thread</a>? </p>
  
  <hr>
  
  <p><strong>Editing the question to help answerers based on answers and comments:</strong></p>
  
  <p>What I am really after: one log10 transformed axis (y) with not scientific labels. I would like to label it like dollar <code>(formatter=dollar)</code> or any custom format.</p>
  
  <p>If I try @hadley's suggestion I get the following warnings:</p>
  
  <pre><code>&gt; m + geom_boxplot() + scale_y_log10(formatter=dollar)
  Warning messages:
  1: In max(x) : no non-missing arguments to max; returning -Inf
  2: In max(x) : no non-missing arguments to max; returning -Inf
  3: In max(x) : no non-missing arguments to max; returning -Inf
  </code></pre>
  
  <p>With an unchanged y axis labels:</p>
  
  <p><img src="https://i.stack.imgur.com/sRScn.png" alt="alt text"></p>