title: How to plot a histogram using a logarithmic scale with Seaborn
body: <p>My question is fairly simple: I would like to visualize multiple histograms using the Seaborn module, however, as a number of bins contain very few counts, I would like to visualize the vertical axis using a logarithmic scale. </p>
  
  <p>My code so far: </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import seaborn as sns
  import matplotlib.pyplot as plt
  
  df = pd.DataFrame(np.random.rand(100,2), columns=['A','B'])
  df = pd.melt(df, var_name='Category')     
  g = sns.FacetGrid(df, col='Category', sharex=True, sharey=False, aspect=1.5)
  g = g.map(plt.hist, "value", color="r")
  </code></pre>
  
  <p>, which gives me the following image: 
  <a href="https://i.stack.imgur.com/iPC5D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iPC5D.png" alt="enter image description here"></a></p>
  
  <p>How do I change the vertical axis to a logarithmic scale (in the most 'pythonic'/'seabornic' way)? I've looked around on various answers, but wasn't satisfied with the answers I found so far. </p>
  
  <p><strong>Update:</strong>
  Adding the following code, following the answer <a href="https://stackoverflow.com/questions/27019153/how-to-scale-seaborns-y-axis-with-a-bar-plot">here</a>, makes my bars vanish: </p>
  
  <pre><code>g.fig.get_axes()[0].set_yscale('log')
  </code></pre>
  
  <p><strong>Update II:</strong> 
  The following code fixed my problem: </p>
  
  <pre><code>df = pd.DataFrame(np.random.rand(100,2), columns=['A','B'])
  df = pd.melt(df, var_name='Category')     
  g = sns.FacetGrid(df, col='Category', sharex=True, sharey=False, aspect=1.5)
  g = g.map(plt.hist, "value", color="r", log=True)
  </code></pre>