<p dir="auto">The following simple example shows an issues with zero values when calling <code class="notranslate">loglog</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt

nu = [1e2, 1e3, 1e4, 1e5, 1e6, 1e7]
fnu = [1, 1e-30, 1e-45, 0., 0., 0.]

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.loglog(nu, fnu, color='blue')
fig.savefig('mpl.png')"><pre class="notranslate"><code class="notranslate">import matplotlib.pyplot as plt

nu = [1e2, 1e3, 1e4, 1e5, 1e6, 1e7]
fnu = [1, 1e-30, 1e-45, 0., 0., 0.]

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.loglog(nu, fnu, color='blue')
fig.savefig('mpl.png')
</code></pre></div>
<p dir="auto">The output is:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/314716/5959827/8d0677cc-a7d1-11e4-8cd3-7227dee4a37a.png"><img src="https://cloud.githubusercontent.com/assets/314716/5959827/8d0677cc-a7d1-11e4-8cd3-7227dee4a37a.png" alt="mpl" style="max-width: 100%;"></a></p>
<p dir="auto">Of course, zero is undefined in log space, but I don't understand why it defaults to plotting a value of 0.1 instead. Doing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fnu = [1, 1e-30, 1e-45, np.nan, np.nan, np.nan]"><pre class="notranslate"><code class="notranslate">fnu = [1, 1e-30, 1e-45, np.nan, np.nan, np.nan]
</code></pre></div>
<p dir="auto">Does the right thing on the other hand. So maybe the best solution is to replace 0 values by np.nan inside <code class="notranslate">loglog</code>?</p>
<p dir="auto">I am using matplotlib 1.5.x with Python 3.4.</p>
<p dir="auto">Consider the following test code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from numpy import *
from matplotlib.pyplot import *


x = arange(-10,10)
y = (1.0 - 1.0/(x**2+1))**20

figure()
semilogy(x, y, &quot;-o&quot;)
grid(True)
savefig(&quot;test.png&quot;)"><pre class="notranslate"><code class="notranslate">from numpy import *
from matplotlib.pyplot import *


x = arange(-10,10)
y = (1.0 - 1.0/(x**2+1))**20

figure()
semilogy(x, y, "-o")
grid(True)
savefig("test.png")
</code></pre></div>
<p dir="auto">Correct Plot (the value y=0 at x=0 is masked out from y-log plot):<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1503544/5724453/e65db9e4-9b4b-11e4-9766-c9196fc32c42.png"><img src="https://cloud.githubusercontent.com/assets/1503544/5724453/e65db9e4-9b4b-11e4-9766-c9196fc32c42.png" alt="test_good" style="max-width: 100%;"></a></p>
<p dir="auto">Wrong Plot (spurious point at x=0 with y=1e-1):<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1503544/5724445/e1b47da6-9b4b-11e4-98da-34fe5cbf778e.png"><img src="https://cloud.githubusercontent.com/assets/1503544/5724445/e1b47da6-9b4b-11e4-98da-34fe5cbf778e.png" alt="test_wrong" style="max-width: 100%;"></a></p>
<p dir="auto">A <code class="notranslate">git bisect</code> tells me that:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="91725d8665975de9a26d631445ab1448b0391e1a is the first bad commit
commit 91725d8665975de9a26d631445ab1448b0391e1a
Author: Joel B. Mohler &lt;joel@kiwistrawberry.us&gt;
Date:   Thu Aug 21 10:43:28 2014 -0400

    use _fast_from_codes_and_verts in transform code"><pre class="notranslate"><code class="notranslate">91725d8665975de9a26d631445ab1448b0391e1a is the first bad commit
commit 91725d8665975de9a26d631445ab1448b0391e1a
Author: Joel B. Mohler &lt;joel@kiwistrawberry.us&gt;
Date:   Thu Aug 21 10:43:28 2014 -0400

    use _fast_from_codes_and_verts in transform code
</code></pre></div>
<p dir="auto">The commit diff introduces the use of <code class="notranslate">_fast_from_codes_and_verts</code>,<br>
so the issue is probably somewhere deeper inside this function.</p>