<h3 dir="auto">Bug summary</h3>
<p dir="auto">The discrete normalizer produces duplicated labels for the same tick and the colorbar is wrong.</p>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import matplotlib.ticker as mticker

fig, ax = plt.subplots()

edges = np.linspace(0, 3, 13)
norm = mcolors.BoundaryNorm(edges, 1000)
Z = np.random.rand(5, 5) * 3

m = ax.pcolormesh(Z, cmap='viridis', norm=norm)
cb = fig.colorbar(m, ticks=mticker.MultipleLocator(0.25))

fig.show()"><pre class="notranslate"><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">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">matplotlib</span>.<span class="pl-s1">colors</span> <span class="pl-k">as</span> <span class="pl-s1">mcolors</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">ticker</span> <span class="pl-k">as</span> <span class="pl-s1">mticker</span>

<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>()

<span class="pl-s1">edges</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">3</span>, <span class="pl-c1">13</span>)
<span class="pl-s1">norm</span> <span class="pl-c1">=</span> <span class="pl-s1">mcolors</span>.<span class="pl-v">BoundaryNorm</span>(<span class="pl-s1">edges</span>, <span class="pl-c1">1000</span>)
<span class="pl-v">Z</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">5</span>, <span class="pl-c1">5</span>) <span class="pl-c1">*</span> <span class="pl-c1">3</span>

<span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">pcolormesh</span>(<span class="pl-v">Z</span>, <span class="pl-s1">cmap</span><span class="pl-c1">=</span><span class="pl-s">'viridis'</span>, <span class="pl-s1">norm</span><span class="pl-c1">=</span><span class="pl-s1">norm</span>)
<span class="pl-s1">cb</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">colorbar</span>(<span class="pl-s1">m</span>, <span class="pl-s1">ticks</span><span class="pl-c1">=</span><span class="pl-s1">mticker</span>.<span class="pl-v">MultipleLocator</span>(<span class="pl-c1">0.25</span>))

<span class="pl-s1">fig</span>.<span class="pl-en">show</span>()</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30388627/144408972-91e06931-6ae0-4a0c-8d48-bf4274bed2aa.png"><img src="https://user-images.githubusercontent.com/30388627/144408972-91e06931-6ae0-4a0c-8d48-bf4274bed2aa.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">Correct ticks and colorbar.</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Ubuntu</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.5.0</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">module://matplotlib_inline.backend_inline</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">Python 3.9.7</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">conda</p>
<p dir="auto">Applies to version 1.4.2</p>
<p dir="auto">When using one of the GUI backends (tested with Tk and Qt using IPython) plot markers are only drawn if <code class="notranslate">markeredgecolor</code> is not set to 'none' and <code class="notranslate">markeredgewidth</code> is nonzero. So</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='blue', 
        markeredgewidth=0.01, markerfacecolor='blue')"><pre class="notranslate"><code class="notranslate">    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='blue', 
        markeredgewidth=0.01, markerfacecolor='blue')
</code></pre></div>
<p dir="auto">draws plot markers while</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='blue',
        markeredgewidth=0, markerfacecolor='blue')"><pre class="notranslate"><code class="notranslate">    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='blue',
        markeredgewidth=0, markerfacecolor='blue')
</code></pre></div>
<p dir="auto">or</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='none', 
        markerfacecolor='blue')"><pre class="notranslate"><code class="notranslate">    plot(linspace(0,2), linspace(0,2)**2, marker='o', markeredgecolor='none', 
        markerfacecolor='blue')
</code></pre></div>
<p dir="auto">don't.</p>
<p dir="auto">Associated with this issue seems to be that the Axes method <code class="notranslate">fill_between</code> doesn’t draw anything if <code class="notranslate">linewidth</code> is set to zero. Could it be that any filled paths without outline are not drawn?</p>
<p dir="auto">Saving the figure to PDF via the GUI is <em>not</em> affected by this issue, saving to PNG is.</p>