<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">I tried to reproduce <a href="https://commons.wikimedia.org/wiki/File:Discrete_Gaussians.svg" rel="nofollow">this figure</a>, but when I plotted using lines and dots, the dots are in the correct place, but the lines are slightly out of place, making things asymmetrical.</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="from scipy.special import iv
import numpy as np


def discrete_gaussian_kernel(n, t):
    T = np.exp(-t) * iv(n, t)
    return T


def sampled_gaussian_kernel(n, t):
    G = 1/np.sqrt(2*np.pi*t) * np.exp(-n**2/(2*t))
    return G

if __name__ == '__main__':
    import matplotlib.pyplot as plt

    plt.figure(figsize=(4, 5))
    for t in (0.5, 1, 2, 4):
        N = 6
        n = np.arange(-N, N+1)
        p = plt.plot(n, discrete_gaussian_kernel(n, t),  '.-', label=t)[0]
        plt.plot(n, sampled_gaussian_kernel(n, t),  ':', color=p.get_color())
    plt.grid(True)
    plt.ylim(0, 0.7)
    plt.xlim(-6, 6)
    plt.legend()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">special</span> <span class="pl-k">import</span> <span class="pl-s1">iv</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-k">def</span> <span class="pl-en">discrete_gaussian_kernel</span>(<span class="pl-s1">n</span>, <span class="pl-s1">t</span>):
    <span class="pl-v">T</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">exp</span>(<span class="pl-c1">-</span><span class="pl-s1">t</span>) <span class="pl-c1">*</span> <span class="pl-en">iv</span>(<span class="pl-s1">n</span>, <span class="pl-s1">t</span>)
    <span class="pl-k">return</span> <span class="pl-v">T</span>


<span class="pl-k">def</span> <span class="pl-en">sampled_gaussian_kernel</span>(<span class="pl-s1">n</span>, <span class="pl-s1">t</span>):
    <span class="pl-v">G</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-c1">/</span><span class="pl-s1">np</span>.<span class="pl-en">sqrt</span>(<span class="pl-c1">2</span><span class="pl-c1">*</span><span class="pl-s1">np</span>.<span class="pl-s1">pi</span><span class="pl-c1">*</span><span class="pl-s1">t</span>) <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-en">exp</span>(<span class="pl-c1">-</span><span class="pl-s1">n</span><span class="pl-c1">**</span><span class="pl-c1">2</span><span class="pl-c1">/</span>(<span class="pl-c1">2</span><span class="pl-c1">*</span><span class="pl-s1">t</span>))
    <span class="pl-k">return</span> <span class="pl-v">G</span>

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">'__main__'</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-s1">plt</span>.<span class="pl-en">figure</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">4</span>, <span class="pl-c1">5</span>))
    <span class="pl-k">for</span> <span class="pl-s1">t</span> <span class="pl-c1">in</span> (<span class="pl-c1">0.5</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">4</span>):
        <span class="pl-v">N</span> <span class="pl-c1">=</span> <span class="pl-c1">6</span>
        <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">-</span><span class="pl-v">N</span>, <span class="pl-v">N</span><span class="pl-c1">+</span><span class="pl-c1">1</span>)
        <span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">n</span>, <span class="pl-en">discrete_gaussian_kernel</span>(<span class="pl-s1">n</span>, <span class="pl-s1">t</span>),  <span class="pl-s">'.-'</span>, <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s1">t</span>)[<span class="pl-c1">0</span>]
        <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">n</span>, <span class="pl-en">sampled_gaussian_kernel</span>(<span class="pl-s1">n</span>, <span class="pl-s1">t</span>),  <span class="pl-s">':'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">p</span>.<span class="pl-en">get_color</span>())
    <span class="pl-s1">plt</span>.<span class="pl-en">grid</span>(<span class="pl-c1">True</span>)
    <span class="pl-s1">plt</span>.<span class="pl-en">ylim</span>(<span class="pl-c1">0</span>, <span class="pl-c1">0.7</span>)
    <span class="pl-s1">plt</span>.<span class="pl-en">xlim</span>(<span class="pl-c1">-</span><span class="pl-c1">6</span>, <span class="pl-c1">6</span>)
    <span class="pl-s1">plt</span>.<span class="pl-en">legend</span>()</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012691-e24ea298-4ea2-11e7-8d62-a8911911a0e1.png"><img src="https://user-images.githubusercontent.com/58611/27012691-e24ea298-4ea2-11e7-8d62-a8911911a0e1.png" alt="figure_1" style="max-width: 100%;"></a></p>
<p dir="auto">The dots look offset on the legend:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012712-6b0e3ee0-4ea3-11e7-9135-1ecda9104722.png"><img src="https://user-images.githubusercontent.com/58611/27012712-6b0e3ee0-4ea3-11e7-9135-1ecda9104722.png" alt="2017-06-11 12_41_54- figure_1 imported -1 0 rgb color 1 layer 400x496 gimp" style="max-width: 100%;"></a></p>
<p dir="auto">But I guess it's actually the lines that are offset and asymmetrical:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012713-75830a9a-4ea3-11e7-82ef-163eb3ae09bc.png"><img src="https://user-images.githubusercontent.com/58611/27012713-75830a9a-4ea3-11e7-82ef-163eb3ae09bc.png" alt="asymmetrical" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">If I save as SVG and open in Firefox, it looks fine:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012701-32cdc3a2-4ea3-11e7-8b1e-c7f6df26d73c.png"><img src="https://user-images.githubusercontent.com/58611/27012701-32cdc3a2-4ea3-11e7-8b1e-c7f6df26d73c.png" alt="svg in firefox" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012724-d24ebc10-4ea3-11e7-9591-29d49fa63c38.png"><img src="https://user-images.githubusercontent.com/58611/27012724-d24ebc10-4ea3-11e7-9591-29d49fa63c38.png" alt="firefox dot" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012725-d556215a-4ea3-11e7-82a1-c29c1b4125ee.png"><img src="https://user-images.githubusercontent.com/58611/27012725-d556215a-4ea3-11e7-82a1-c29c1b4125ee.png" alt="firefox symmetry" style="max-width: 100%;"></a></p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating System: Windows 7 Pro 64-bit</li>
<li>Matplotlib Version: 2.0.2</li>
<li>Python Version: 3.6.0</li>
<li>Jupyter Version (if applicable): IPython 5.1.0</li>
</ul>
<p dir="auto">This is inside Spyder 3.1.4 installed from default Anaconda channel, with graphics backend set to "automatic":</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/27012759-d87c29e6-4ea4-11e7-9f00-74f51fd41264.png"><img src="https://user-images.githubusercontent.com/58611/27012759-d87c29e6-4ea4-11e7-9f00-74f51fd41264.png" alt="2017-06-11 12_51_28-preferences" style="max-width: 100%;"></a></p>
<p dir="auto">mpl 1.5.3/2.0b4/master, no matplotlibrc</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="_xs = np.linspace(0, 30, 201); plt.plot(_xs, scipy.stats.lognorm.pdf(_xs / 14, .472) / 14, &quot;.&quot;)"><pre class="notranslate"><code class="notranslate">_xs = np.linspace(0, 30, 201); plt.plot(_xs, scipy.stats.lognorm.pdf(_xs / 14, .472) / 14, ".")
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1322974/19205573/2ae8b19c-8c98-11e6-84f8-89ecbdca82c1.png"><img src="https://cloud.githubusercontent.com/assets/1322974/19205573/2ae8b19c-8c98-11e6-84f8-89ecbdca82c1.png" alt="plot" style="max-width: 100%;"></a></p>
<p dir="auto">Note the slight inaccuracy in positioning of the markers at the positioning of the markers at the positions marked with the red circles, resulting in a "step-like" behavior (you may need to open the image in a larger viewer to notice it).</p>
<p dir="auto">The data itself does not present this behavior, as can be checked just by zooming in these regions.</p>