<p dir="auto">I have generated a million binomial numbers using <code class="notranslate">scipy.stats.binom.rvs(n = 100, p = 0.5, size = 1000000)</code> , and certainly did not expected a histogram to have 'gaps':</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/628457/18817744/7a9f35be-8368-11e6-96ea-6035a6e3252e.png"><img width="524" alt="histogram" src="https://cloud.githubusercontent.com/assets/628457/18817744/7a9f35be-8368-11e6-96ea-6035a6e3252e.png" style="max-width: 100%;"></a></p>
<p dir="auto">The funny thing is, that does not happen always. As I don't have the seed I generated these values with, I've attached the particular data causing this issue here: <a href="https://github.com/mwaskom/seaborn/files/491852/observations.txt.gz">observations.txt.gz</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import seaborn as sb
import pandas as pd

my_data = pd.read_csv('/tmp/observations.txt.gz')
sb.distplot(my_data, kde = False)"><pre class="notranslate"><code class="notranslate">import seaborn as sb
import pandas as pd

my_data = pd.read_csv('/tmp/observations.txt.gz')
sb.distplot(my_data, kde = False)
</code></pre></div>
<p dir="auto">The versions I'm using are:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import seaborn as sb
&gt;&gt;&gt; sb.__version__
'0.7.1'
&gt;&gt;&gt; import matplotlib as mpl
&gt;&gt;&gt; mpl.__version__
'1.5.1'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import seaborn as sb
&gt;&gt;&gt; sb.__version__
'0.7.1'
&gt;&gt;&gt; import matplotlib as mpl
&gt;&gt;&gt; mpl.__version__
'1.5.1'
</code></pre></div>
<p dir="auto">The histogram is correct in a sense that all bins have their 'mass', however visually (without ticks for each value) it looks a bit off / misleading.</p>
<p dir="auto">You can verify all values are present using e.g. <code class="notranslate">pd.Series(my_data).value_counts()</code>. I've noticed these gaps do not depend on the size of the plot.</p>
<p dir="auto">An issue that arises when plotting histograms of discrete data with Matplotlib seems to also come up in <code class="notranslate">distplot</code> as well. That is, there are often empty bins in the histogram that are entirely artifacts of the plot. See here for an example with Poisson data:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4bef2612a9741b9dc1cc8d7739b676da5c92ca022bfa0aaac8ab2744651c6edb/687474703a2f2f642e70722f692f31653238552b"><img src="https://camo.githubusercontent.com/4bef2612a9741b9dc1cc8d7739b676da5c92ca022bfa0aaac8ab2744651c6edb/687474703a2f2f642e70722f692f31653238552b" alt="poisson data" data-canonical-src="http://d.pr/i/1e28U+" style="max-width: 100%;"></a></p>
<p dir="auto">Is there any way that <code class="notranslate">distplot</code> could try to detect this and adjust the bins automagically?</p>