<p dir="auto">When enabling log scale for the bar plot, the bars are not plotted properly and the plot is empty.</p>
<p dir="auto">See also this bug report <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1087901" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/163" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/163/hovercard" href="https://github.com/matplotlib/matplotlib/issues/163">#163</a> and the corresponding fix <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="15879439" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/2147" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/2147/hovercard" href="https://github.com/matplotlib/matplotlib/pull/2147">#2147</a>.</p>
<p dir="auto">Commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/matplotlib/matplotlib/commit/dda42abd96332578d6764c8f00ae6f520f0691bd/hovercard" href="https://github.com/matplotlib/matplotlib/commit/dda42abd96332578d6764c8f00ae6f520f0691bd"><tt>dda42ab</tt></a> changed the default value of <code class="notranslate">nonpos</code> parameter from <code class="notranslate">clip</code> to <code class="notranslate">mask</code> which introduced the issue. I cannot tell whether <code class="notranslate">clip</code> should be default behavior or <code class="notranslate">mask</code> doesn't work as intended.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
plt.bar(x=[1,2,3], height=[1000,2,3])
plt.yscale(&quot;log&quot;)
plt.show()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span>[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s1">height</span><span class="pl-c1">=</span>[<span class="pl-c1">1000</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">yscale</span>(<span class="pl-s">"log"</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto">Result is an empty plot. Saving to an image file or PDF doesn't make a change.</p>
<p dir="auto">Adding</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plt.yscale(&quot;log&quot;, nonposy=&quot;clip&quot;)"><pre class="notranslate"><span class="pl-s1">plt</span>.<span class="pl-en">yscale</span>(<span class="pl-s">"log"</span>, <span class="pl-s1">nonposy</span><span class="pl-c1">=</span><span class="pl-s">"clip"</span>)</pre></div>
<p dir="auto">fixes that issue.</p>
<p dir="auto">Additional info:<br>
Latest Miniconda<br>
Various platforms (Ubuntu 16.04, Windows 10, macOS)<br>
Matplotlib 2.1.0, Qt5Agg (from Anaconda)</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Setting a logarithmic y-axis with <code class="notranslate">ax.set_yscale('log')</code> causes histograms to disappear from the axis. This occurs in <a href="https://github.com/matplotlib/matplotlib/releases/tag/v2.1.0">2.1.0</a> but not in 2.0.2.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np

xs = np.random.normal(size=int(1e6))
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.hist(xs, range=(-5, 5), bins=100)
ax2.hist(xs, range=(-5, 5), bins=100)
ax2.set_ylim(ymin=1)
ax2.set_yscale('log')
fig.savefig('histogram.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-s1">matplotlib</span>.<span class="pl-en">use</span>(<span class="pl-s">'Agg'</span>)
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-s1">xs</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-s1">size</span><span class="pl-c1">=</span><span class="pl-en">int</span>(<span class="pl-c1">1e6</span>))
<span class="pl-s1">fig</span>, (<span class="pl-s1">ax1</span>, <span class="pl-s1">ax2</span>) <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">1</span>, <span class="pl-c1">2</span>)
<span class="pl-s1">ax1</span>.<span class="pl-en">hist</span>(<span class="pl-s1">xs</span>, <span class="pl-s1">range</span><span class="pl-c1">=</span>(<span class="pl-c1">-</span><span class="pl-c1">5</span>, <span class="pl-c1">5</span>), <span class="pl-s1">bins</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">hist</span>(<span class="pl-s1">xs</span>, <span class="pl-s1">range</span><span class="pl-c1">=</span>(<span class="pl-c1">-</span><span class="pl-c1">5</span>, <span class="pl-c1">5</span>), <span class="pl-s1">bins</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">set_ylim</span>(<span class="pl-s1">ymin</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">set_yscale</span>(<span class="pl-s">'log'</span>)
<span class="pl-s1">fig</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'histogram.png'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto">With <strong>2.1.0</strong>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/540853/31249955-9632ab66-aa19-11e7-8aab-c6a7ccac306f.png"><img src="https://user-images.githubusercontent.com/540853/31249955-9632ab66-aa19-11e7-8aab-c6a7ccac306f.png" alt="2.1.0" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">I expect to see a logarithm y-axis <em>and</em> the histogram, but I only see the former. With <strong>2.0.2</strong> I see this:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/540853/31249924-795ab998-aa19-11e7-8c3f-f205ea54e817.png"><img src="https://user-images.githubusercontent.com/540853/31249924-795ab998-aa19-11e7-8c3f-f205ea54e817.png" alt="2.0.2" style="max-width: 100%;"></a></p>