<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/matplotlib/matplotlib/blob/31d2c2ff9b652a03d58c77529326e21a2cdb31ae/lib/matplotlib/tests/test_axes.py#L1132-L1155">matplotlib/lib/matplotlib/tests/test_axes.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 1132 to 1155
      in
      <a data-pjax="true" class="commit-tease-sha" href="/matplotlib/matplotlib/commit/31d2c2ff9b652a03d58c77529326e21a2cdb31ae">31d2c2f</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L1132" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1132"></td>
          <td id="LC1132" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">@<span class="pl-en">image_comparison</span>(<span class="pl-s1">baseline_images</span><span class="pl-c1">=</span>[<span class="pl-s">'pcolormesh'</span>], <span class="pl-s1">remove_text</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1133" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1133"></td>
          <td id="LC1133" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">test_pcolormesh</span>(): </td>
        </tr>

        <tr class="border-0">
          <td id="L1134" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1134"></td>
          <td id="LC1134" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-c1">12</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1135" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1135"></td>
          <td id="LC1135" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">-</span><span class="pl-c1">1.5</span>, <span class="pl-c1">1.5</span>, <span class="pl-s1">n</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1136" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1136"></td>
          <td id="LC1136" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">-</span><span class="pl-c1">1.5</span>, <span class="pl-c1">1.5</span>, <span class="pl-s1">n</span><span class="pl-c1">*</span><span class="pl-c1">2</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1137" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1137"></td>
          <td id="LC1137" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">X</span>, <span class="pl-v">Y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">meshgrid</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1138" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1138"></td>
          <td id="LC1138" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Qx</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">cos</span>(<span class="pl-v">Y</span>) <span class="pl-c1">-</span> <span class="pl-s1">np</span>.<span class="pl-en">cos</span>(<span class="pl-v">X</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1139" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1139"></td>
          <td id="LC1139" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Qz</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">sin</span>(<span class="pl-v">Y</span>) <span class="pl-c1">+</span> <span class="pl-s1">np</span>.<span class="pl-en">sin</span>(<span class="pl-v">X</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1140" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1140"></td>
          <td id="LC1140" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Qx</span> <span class="pl-c1">=</span> (<span class="pl-v">Qx</span> <span class="pl-c1">+</span> <span class="pl-c1">1.1</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1141" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1141"></td>
          <td id="LC1141" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Z</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">hypot</span>(<span class="pl-v">X</span>, <span class="pl-v">Y</span>) <span class="pl-c1">/</span> <span class="pl-c1">5</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1142" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1142"></td>
          <td id="LC1142" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Z</span> <span class="pl-c1">=</span> (<span class="pl-v">Z</span> <span class="pl-c1">-</span> <span class="pl-v">Z</span>.<span class="pl-en">min</span>()) <span class="pl-c1">/</span> <span class="pl-v">Z</span>.<span class="pl-en">ptp</span>() </td>
        </tr>

        <tr class="border-0">
          <td id="L1143" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1143"></td>
          <td id="LC1143" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L1144" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1144"></td>
          <td id="LC1144" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c"># The color array can include masked values:</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1145" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1145"></td>
          <td id="LC1145" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-v">Zm</span> <span class="pl-c1">=</span> <span class="pl-s1">ma</span>.<span class="pl-en">masked_where</span>(<span class="pl-s1">np</span>.<span class="pl-en">abs</span>(<span class="pl-v">Qz</span>) <span class="pl-c1">&lt;</span> <span class="pl-c1">0.5</span> <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-en">max</span>(<span class="pl-v">Qz</span>), <span class="pl-v">Z</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1146" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1146"></td>
          <td id="LC1146" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L1147" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1147"></td>
          <td id="LC1147" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>() </td>
        </tr>

        <tr class="border-0">
          <td id="L1148" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1148"></td>
          <td id="LC1148" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">add_subplot</span>(<span class="pl-c1">131</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1149" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1149"></td>
          <td id="LC1149" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span>.<span class="pl-en">pcolormesh</span>(<span class="pl-v">Qx</span>, <span class="pl-v">Qz</span>, <span class="pl-v">Z</span>, <span class="pl-s1">lw</span><span class="pl-c1">=</span><span class="pl-c1">0.5</span>, <span class="pl-s1">edgecolors</span><span class="pl-c1">=</span><span class="pl-s">'k'</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1150" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1150"></td>
          <td id="LC1150" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L1151" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1151"></td>
          <td id="LC1151" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">add_subplot</span>(<span class="pl-c1">132</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1152" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1152"></td>
          <td id="LC1152" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span>.<span class="pl-en">pcolormesh</span>(<span class="pl-v">Qx</span>, <span class="pl-v">Qz</span>, <span class="pl-v">Z</span>, <span class="pl-s1">lw</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">edgecolors</span><span class="pl-c1">=</span>[<span class="pl-s">'b'</span>, <span class="pl-s">'w'</span>]) </td>
        </tr>

        <tr class="border-0">
          <td id="L1153" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1153"></td>
          <td id="LC1153" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L1154" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1154"></td>
          <td id="LC1154" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">add_subplot</span>(<span class="pl-c1">133</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1155" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1155"></td>
          <td id="LC1155" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">ax</span>.<span class="pl-en">pcolormesh</span>(<span class="pl-v">Qx</span>, <span class="pl-v">Qz</span>, <span class="pl-v">Z</span>, <span class="pl-s1">shading</span><span class="pl-c1">=</span><span class="pl-s">"gouraud"</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">Note that <code class="notranslate">Zm</code> is unused; and thus there is no test for <code class="notranslate">pcolormesh</code> with a masked array as input.</p>
<p dir="auto">The <code class="notranslate">pcolormesh</code> test says that <a href="https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_axes.py#L991-L992">masked colour arrays are supported</a>, but this masked <code class="notranslate">Zm</code> variable is never used in the test. It appears that this has been the case since the test was added.</p>
<p dir="auto">I'm not sure exactly how the "correct" masked result should look, or I would update this myself. I hope one of the assignees should have some idea what to do here.</p>