<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">imshow is not displaying data accurately. Non existent values displayed in images, white spots as shown below. This issue was also occurring in 3.2.1.</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 numpy as np 
import matplotlib.pyplot as plt
from matplotlib.colors import from_levels_and_colors

rnd = np.random.default_rng(32)
data = rnd.choice((0, 1), (200, 200), p=(.25, .75))

cmap, norm = from_levels_and_colors([0, .5, 1], ['red', 'blue'])
plt.imshow(data, cmap = cmap)
plt.colorbar()
plt.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">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">colors</span> <span class="pl-k">import</span> <span class="pl-s1">from_levels_and_colors</span>

<span class="pl-s1">rnd</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">default_rng</span>(<span class="pl-c1">32</span>)
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">rnd</span>.<span class="pl-en">choice</span>((<span class="pl-c1">0</span>, <span class="pl-c1">1</span>), (<span class="pl-c1">200</span>, <span class="pl-c1">200</span>), <span class="pl-s1">p</span><span class="pl-c1">=</span>(<span class="pl-c1">.25</span>, <span class="pl-c1">.75</span>))

<span class="pl-s1">cmap</span>, <span class="pl-s1">norm</span> <span class="pl-c1">=</span> <span class="pl-en">from_levels_and_colors</span>([<span class="pl-c1">0</span>, <span class="pl-c1">.5</span>, <span class="pl-c1">1</span>], [<span class="pl-s">'red'</span>, <span class="pl-s">'blue'</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">imshow</span>(<span class="pl-s1">data</span>, <span class="pl-s1">cmap</span> <span class="pl-c1">=</span> <span class="pl-s1">cmap</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">colorbar</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">show</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/64583949/85404321-b2373980-b556-11ea-83ff-07af69ff04a9.png"><img src="https://user-images.githubusercontent.com/64583949/85404321-b2373980-b556-11ea-83ff-07af69ff04a9.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/64583949/85404727-4c977d00-b557-11ea-9483-46cc2c4716a9.png"><img src="https://user-images.githubusercontent.com/64583949/85404727-4c977d00-b557-11ea-9483-46cc2c4716a9.png" alt="test1" style="max-width: 100%;"></a></p>
<p dir="auto">As displayed with matplotlib 3.1.3.</p>


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

<ul dir="auto">
<li>Operating system: Windows 10</li>
<li>Matplotlib version: 3.2.1 and 3.2.2</li>
<li>Matplotlib backend: module://ipykernel.pylab.backend_inline</li>
<li>Python version: 3.7.7 (default, Apr 15 2020, 05:09:04) [MSC v.1916 64 bit (AMD64)]</li>
<li>Jupyter version (if applicable):  jupyter core: 4.6.3, jupyter-notebook: 6.0.3, jupyter client: 6.1.3, jupyter lab: 2.1.1</li>
<li>Other libraries: numpy 1.18.1</li>
</ul>

<p dir="auto">Pip install 3.2.1 and 3.2.2.</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto"><code class="notranslate">imshow()</code> plots different results between versions 3.1.2 and 3.2.2 for masked numpy arrays. The latest version is missing pixels that were plotted in the older version.</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 numpy as np
import matplotlib.pyplot as plt

arr = np.ma.masked_values(
    np.load('test.npz')['arr_0'],
    -9999
)
np.ma.masked_where(arr &lt;= 0, arr, copy=False);

plt.figure()
plt.imshow(arr);"><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-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_values</span>(
    <span class="pl-s1">np</span>.<span class="pl-en">load</span>(<span class="pl-s">'test.npz'</span>)[<span class="pl-s">'arr_0'</span>],
    <span class="pl-c1">-</span><span class="pl-c1">9999</span>
)
<span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_where</span>(<span class="pl-s1">arr</span> <span class="pl-c1">&lt;=</span> <span class="pl-c1">0</span>, <span class="pl-s1">arr</span>, <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-c1">False</span>);

<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">imshow</span>(<span class="pl-s1">arr</span>);</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<ul dir="auto">
<li>
<p dir="auto">Expected and correct result with 3.1.2<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/178649/85324214-a54b1500-b486-11ea-8971-af055ecc2dca.png"><img src="https://user-images.githubusercontent.com/178649/85324214-a54b1500-b486-11ea-8971-af055ecc2dca.png" alt="Unknown-1" style="max-width: 100%;"></a></p>
</li>
<li>
<p dir="auto">Results using 3.2.2<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/178649/85324221-a9773280-b486-11ea-98f3-2f1e78bb0430.png"><img src="https://user-images.githubusercontent.com/178649/85324221-a9773280-b486-11ea-98f3-2f1e78bb0430.png" alt="Unknown" style="max-width: 100%;"></a></p>
</li>
</ul>
<p dir="auto"><strong>TestFile</strong><br>
<a href="https://drive.google.com/file/d/1upNDEqmw7P6Ij8h9Xy0ACBt3t_471DCO/view" rel="nofollow">test.pyz</a></p>
<p dir="auto">Both versions were installed via conda. Numpy is 1.18.5</p>