<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto"><code class="notranslate">Path.intersects_path</code> returns <code class="notranslate">True</code> for the following paths, when they don't intersect at all (as shown by Shapely). This is a simplified <code class="notranslate">outline_path</code> from Cartopy. The trigger seems to be the duplicate point at the end of <code class="notranslate">outline_path</code>; if removed, it works as expected.</p>
<p dir="auto">A bisect says this broke in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/matplotlib/matplotlib/commit/bd3fd8f46a08269be715afc715344dd5719183ac/hovercard" href="https://github.com/matplotlib/matplotlib/commit/bd3fd8f46a08269be715afc715344dd5719183ac"><tt>bd3fd8f</tt></a>, which is a backport of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="337597320" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/11553" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/11553/hovercard" href="https://github.com/matplotlib/matplotlib/pull/11553">#11553</a> to 3.1.0. cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/TarasKuzyo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/TarasKuzyo">@TarasKuzyo</a></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 as mpl
from matplotlib.path import Path
from shapely.geometry import LinearRing


this_path = Path(
    np.array([
        [824.85064295, 2056.26489203],
        [861.69033931, 2041.00539016],
        [868.57864109, 2057.63522175],
        [831.73894473, 2072.89472361],
        [824.85064295, 2056.26489203]]),
    np.array([1, 2, 2, 2, 79], dtype=Path.code_type))
this_ring = LinearRing(this_path.vertices)

outline_path = Path(
    np.array([
        [859.91051028, 2165.38461538],
        [859.06772495, 2149.30331334],
        [859.06772495, 2181.46591743],
        [859.91051028, 2165.38461538],
        [859.91051028, 2165.38461538]]),
    np.array([1, 2, 2, 2, 2],
             dtype=Path.code_type))
outline_ring = LinearRing(outline_path.vertices)

print(mpl.__version__, outline_path.intersects_path(this_path),
      outline_ring.intersects(this_ring))"><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-k">as</span> <span class="pl-s1">mpl</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">path</span> <span class="pl-k">import</span> <span class="pl-v">Path</span>
<span class="pl-k">from</span> <span class="pl-s1">shapely</span>.<span class="pl-s1">geometry</span> <span class="pl-k">import</span> <span class="pl-v">LinearRing</span>


<span class="pl-s1">this_path</span> <span class="pl-c1">=</span> <span class="pl-v">Path</span>(
    <span class="pl-s1">np</span>.<span class="pl-en">array</span>([
        [<span class="pl-c1">824.85064295</span>, <span class="pl-c1">2056.26489203</span>],
        [<span class="pl-c1">861.69033931</span>, <span class="pl-c1">2041.00539016</span>],
        [<span class="pl-c1">868.57864109</span>, <span class="pl-c1">2057.63522175</span>],
        [<span class="pl-c1">831.73894473</span>, <span class="pl-c1">2072.89472361</span>],
        [<span class="pl-c1">824.85064295</span>, <span class="pl-c1">2056.26489203</span>]]),
    <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">79</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-v">Path</span>.<span class="pl-s1">code_type</span>))
<span class="pl-s1">this_ring</span> <span class="pl-c1">=</span> <span class="pl-v">LinearRing</span>(<span class="pl-s1">this_path</span>.<span class="pl-s1">vertices</span>)

<span class="pl-s1">outline_path</span> <span class="pl-c1">=</span> <span class="pl-v">Path</span>(
    <span class="pl-s1">np</span>.<span class="pl-en">array</span>([
        [<span class="pl-c1">859.91051028</span>, <span class="pl-c1">2165.38461538</span>],
        [<span class="pl-c1">859.06772495</span>, <span class="pl-c1">2149.30331334</span>],
        [<span class="pl-c1">859.06772495</span>, <span class="pl-c1">2181.46591743</span>],
        [<span class="pl-c1">859.91051028</span>, <span class="pl-c1">2165.38461538</span>],
        [<span class="pl-c1">859.91051028</span>, <span class="pl-c1">2165.38461538</span>]]),
    <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>],
             <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-v">Path</span>.<span class="pl-s1">code_type</span>))
<span class="pl-s1">outline_ring</span> <span class="pl-c1">=</span> <span class="pl-v">LinearRing</span>(<span class="pl-s1">outline_path</span>.<span class="pl-s1">vertices</span>)

<span class="pl-en">print</span>(<span class="pl-s1">mpl</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">outline_path</span>.<span class="pl-en">intersects_path</span>(<span class="pl-s1">this_path</span>),
      <span class="pl-s1">outline_ring</span>.<span class="pl-en">intersects</span>(<span class="pl-s1">this_ring</span>))</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3.1.2 True False"><pre class="notranslate"><code class="notranslate">3.1.2 True False
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3.1.2 False False"><pre class="notranslate"><code class="notranslate">3.1.2 False False
</code></pre></div>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Operating system: Fedora 30</li>
<li>Matplotlib version: 3.1.2</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): N/A</li>
<li>Python version: 3.7</li>
<li>Jupyter version (if applicable): N/A</li>
<li>Other libraries: N/A</li>
</ul>
<p dir="auto">This no longer works:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
from cycler import cycler
plt.rc('axes', prop_cycle=(
    cycler('dashes', [(None, None), (None, None), (6, 6), (3, 3), (1.5, 1.5)])))"><pre class="notranslate"><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">cycler</span> <span class="pl-k">import</span> <span class="pl-s1">cycler</span>
<span class="pl-s1">plt</span>.<span class="pl-en">rc</span>(<span class="pl-s">'axes'</span>, <span class="pl-s1">prop_cycle</span><span class="pl-c1">=</span>(
    <span class="pl-en">cycler</span>(<span class="pl-s">'dashes'</span>, [(<span class="pl-c1">None</span>, <span class="pl-c1">None</span>), (<span class="pl-c1">None</span>, <span class="pl-c1">None</span>), (<span class="pl-c1">6</span>, <span class="pl-c1">6</span>), (<span class="pl-c1">3</span>, <span class="pl-c1">3</span>), (<span class="pl-c1">1.5</span>, <span class="pl-c1">1.5</span>)])))</pre></div>
<p dir="auto">but it used to work in 1.5.</p>
<p dir="auto">Now it yields</p>
<blockquote>
<p dir="auto">TypeError: float() argument must be a string or a number, not 'NoneType'</p>
</blockquote>