title: What does `log = True` actually do in matplotlib?
body: <p>My MCVE:</p>
  
  <pre><code>    import numpy as np
      import matplotlib.mlab as mlab
      import matplotlib.pyplot as plt
  
      #normal sample
      mu, sigma = 100, 15
      x = mu + sigma*np.random.randn(10000)
  
      #histogram
      n, bins, patches = plt.hist(x, 50)
      plt.axis([40, 160, 0, 800])
      n2, bins2, patches2 = plt.hist(x,50,log=True)
      n1 = np.log(n)
  </code></pre>
  
  <p>now why <code>n2</code> is different from <code>n1</code>? I thought that the <code>log = True</code> scaled everything logarithmically.. but it doesn't. So what is it doing? Same thing happens for <code>bins2</code> and <code>bins1 = np.log(bins)</code>.</p>
  
  <p><strong>edit</strong>
  This     </p>
  
  <pre><code>    mu, sigma = 100, 15
      x = mu + sigma*np.random.randn(10000)
      hist, bin_edges = np.histogram(x,50)
      nwidth = bin_edges[7]-bin_edges[6]   #just difference between two random bins
      plt.bar(np.delete(bin_edges,len(bin_edges)-1),hist,nwidth)  #so I have the right number of bins
      plt.show()
  </code></pre>
  
  <p>gives me </p>
  
  <p><a href="https://i.stack.imgur.com/ZQ8My.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZQ8My.png" alt="a"></a></p>
  
  <p>then by doing </p>
  
  <pre><code>histsq = np.sqrt(np.log(hist))
  plt.bar(np.delete(bin_edges,len(bin_edges)-1),histsq,nwidth)
  plt.show()
  </code></pre>
  
  <p>I obtain </p>
  
  <p><a href="https://i.stack.imgur.com/QuiSk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QuiSk.png" alt="b"></a></p>