<h3 dir="auto">Bug report</h3>
<p dir="auto">When I try to run the tests, all the <code class="notranslate">.svg</code> tests fail because of an Inkscape crash. When a svg test runs, an Inkscape window opens:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6197628/88478714-6eaf6100-cf42-11ea-91e9-4843068b68c4.png"><img width="463" alt="Screenshot 2020-07-26 at 13 15 44" src="https://user-images.githubusercontent.com/6197628/88478714-6eaf6100-cf42-11ea-91e9-4843068b68c4.png" style="max-width: 100%;"></a><br>
Clicking through this leads to another window:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6197628/88478721-78d15f80-cf42-11ea-802f-2b3caff9a5f0.png"><img width="381" alt="Screenshot 2020-07-26 at 13 15 54" src="https://user-images.githubusercontent.com/6197628/88478721-78d15f80-cf42-11ea-802f-2b3caff9a5f0.png" style="max-width: 100%;"></a><br>
which then leads to the test crashing. My Inkscape version is Inkscape 1.0beta2 (2b71d25, 2019-12-03), installd through homebrew. Perhaps this is a compatability issue with Inkscape 1.0?</p>
<p dir="auto">The full traceback is:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="___________________________________________________________________________ test_clip_to_bbox[svg] ___________________________________________________________________________

self = &lt;matplotlib.testing.compare._SVGConverter object at 0x7f9dc869d730&gt;, orig = PosixPath('/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg')
dest = PosixPath('/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox_svg.png')

    def __call__(self, orig, dest):
        old_inkscape = mpl._get_executable_info(&quot;inkscape&quot;).version &lt; &quot;1&quot;
        terminator = b&quot;\n&gt;&quot; if old_inkscape else b&quot;&gt; &quot;
        if not hasattr(self, &quot;_tmpdir&quot;):
            self._tmpdir = TemporaryDirectory()
        if (not self._proc  # First run.
                or self._proc.poll() is not None):  # Inkscape terminated.
            env = {
                **os.environ,
                # If one passes e.g. a png file to Inkscape, it will try to
                # query the user for conversion options via a GUI (even with
                # `--without-gui`).  Unsetting `DISPLAY` prevents this (and
                # causes GTK to crash and Inkscape to terminate, but that'll
                # just be reported as a regular exception below).
                &quot;DISPLAY&quot;: &quot;&quot;,
                # Do not load any user options.
                &quot;INKSCAPE_PROFILE_DIR&quot;: os.devnull,
            }
            # Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
            # deadlock when stderr is redirected to a pipe, so we redirect it
            # to a temporary file instead.  This is not necessary anymore as of
            # Inkscape 0.92.1.
            stderr = TemporaryFile()
            self._proc = subprocess.Popen(
                [&quot;inkscape&quot;, &quot;--without-gui&quot;, &quot;--shell&quot;] if old_inkscape else
                [&quot;inkscape&quot;, &quot;--shell&quot;],
                stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr,
                env=env, cwd=self._tmpdir.name)
            # Slight abuse, but makes shutdown handling easier.
            self._proc.stderr = stderr
            try:
&gt;               self._read_until(terminator)

lib/matplotlib/testing/compare.py:191: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;matplotlib.testing.compare._SVGConverter object at 0x7f9dc869d730&gt;, terminator = b'&gt; '

    def _read_until(self, terminator):
        &quot;&quot;&quot;Read until the prompt is reached.&quot;&quot;&quot;
        buf = bytearray()
        while True:
            c = self._proc.stdout.read(1)
            if not c:
&gt;               raise _ConverterError
E               matplotlib.testing.compare._ConverterError

lib/matplotlib/testing/compare.py:115: _ConverterError

The above exception was the direct cause of the following exception:

expected = '/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox-expected.svg'
actual = '/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg', tol = 0, in_decorator = True

    def compare_images(expected, actual, tol, in_decorator=False):
        &quot;&quot;&quot;
        Compare two &quot;image&quot; files checking differences within a tolerance.
    
        The two given filenames may point to files which are convertible to
        PNG via the `.converter` dictionary. The underlying RMS is calculated
        with the `.calculate_rms` function.
    
        Parameters
        ----------
        expected : str
            The filename of the expected image.
        actual : str
            The filename of the actual image.
        tol : float
            The tolerance (a color value difference, where 255 is the
            maximal difference).  The test fails if the average pixel
            difference is greater than this value.
        in_decorator : bool
            Determines the output format. If called from image_comparison
            decorator, this should be True. (default=False)
    
        Returns
        -------
        None or dict or str
            Return *None* if the images are equal within the given tolerance.
    
            If the images differ, the return value depends on  *in_decorator*.
            If *in_decorator* is true, a dict with the following entries is
            returned:
    
            - *rms*: The RMS of the image difference.
            - *expected*: The filename of the expected image.
            - *actual*: The filename of the actual image.
            - *diff_image*: The filename of the difference image.
            - *tol*: The comparison tolerance.
    
            Otherwise, a human-readable multi-line string representation of this
            information is returned.
    
        Examples
        --------
        ::
    
            img1 = &quot;./baseline/plot.png&quot;
            img2 = &quot;./output/plot.png&quot;
            compare_images(img1, img2, 0.001)
    
        &quot;&quot;&quot;
        actual = os.fspath(actual)
        if not os.path.exists(actual):
            raise Exception(&quot;Output image %s does not exist.&quot; % actual)
        if os.stat(actual).st_size == 0:
            raise Exception(&quot;Output image file %s is empty.&quot; % actual)
    
        # Convert the image to png
        expected = os.fspath(expected)
        if not os.path.exists(expected):
            raise IOError('Baseline image %r does not exist.' % expected)
        extension = expected.split('.')[-1]
        if extension != 'png':
&gt;           actual = convert(actual, cache=False)

lib/matplotlib/testing/compare.py:390: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
lib/matplotlib/testing/compare.py:294: in convert
    converter[path.suffix[1:]](path, newpath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;matplotlib.testing.compare._SVGConverter object at 0x7f9dc869d730&gt;, orig = PosixPath('/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg')
dest = PosixPath('/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox_svg.png')

    def __call__(self, orig, dest):
        old_inkscape = mpl._get_executable_info(&quot;inkscape&quot;).version &lt; &quot;1&quot;
        terminator = b&quot;\n&gt;&quot; if old_inkscape else b&quot;&gt; &quot;
        if not hasattr(self, &quot;_tmpdir&quot;):
            self._tmpdir = TemporaryDirectory()
        if (not self._proc  # First run.
                or self._proc.poll() is not None):  # Inkscape terminated.
            env = {
                **os.environ,
                # If one passes e.g. a png file to Inkscape, it will try to
                # query the user for conversion options via a GUI (even with
                # `--without-gui`).  Unsetting `DISPLAY` prevents this (and
                # causes GTK to crash and Inkscape to terminate, but that'll
                # just be reported as a regular exception below).
                &quot;DISPLAY&quot;: &quot;&quot;,
                # Do not load any user options.
                &quot;INKSCAPE_PROFILE_DIR&quot;: os.devnull,
            }
            # Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
            # deadlock when stderr is redirected to a pipe, so we redirect it
            # to a temporary file instead.  This is not necessary anymore as of
            # Inkscape 0.92.1.
            stderr = TemporaryFile()
            self._proc = subprocess.Popen(
                [&quot;inkscape&quot;, &quot;--without-gui&quot;, &quot;--shell&quot;] if old_inkscape else
                [&quot;inkscape&quot;, &quot;--shell&quot;],
                stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr,
                env=env, cwd=self._tmpdir.name)
            # Slight abuse, but makes shutdown handling easier.
            self._proc.stderr = stderr
            try:
                self._read_until(terminator)
            except _ConverterError as err:
&gt;               raise OSError(&quot;Failed to start Inkscape in interactive &quot;
                              &quot;mode&quot;) from err
E               OSError: Failed to start Inkscape in interactive mode

lib/matplotlib/testing/compare.py:193: OSError"><pre class="notranslate"><span class="pl-s1">___________________________________________________________________________</span> <span class="pl-s1">test_clip_to_bbox</span>[<span class="pl-s1">svg</span>] <span class="pl-s1">___________________________________________________________________________</span>

<span class="pl-s1">self</span> <span class="pl-c1">=</span> <span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">testing</span>.<span class="pl-s1">compare</span>.<span class="pl-s1">_SVGConverter</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x7f9dc869d730</span><span class="pl-c1">&gt;</span>, <span class="pl-s1">orig</span> <span class="pl-c1">=</span> <span class="pl-v">PosixPath</span>(<span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg'</span>)
<span class="pl-s1">dest</span> <span class="pl-c1">=</span> <span class="pl-v">PosixPath</span>(<span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox_svg.png'</span>)

    <span class="pl-k">def</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">orig</span>, <span class="pl-s1">dest</span>):
        <span class="pl-s1">old_inkscape</span> <span class="pl-c1">=</span> <span class="pl-s1">mpl</span>.<span class="pl-en">_get_executable_info</span>(<span class="pl-s">"inkscape"</span>).<span class="pl-s1">version</span> <span class="pl-c1">&lt;</span> <span class="pl-s">"1"</span>
        <span class="pl-s1">terminator</span> <span class="pl-c1">=</span> <span class="pl-s">b"<span class="pl-cce">\n</span>&gt;"</span> <span class="pl-k">if</span> <span class="pl-s1">old_inkscape</span> <span class="pl-k">else</span> <span class="pl-s">b"&gt; "</span>
        <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-en">hasattr</span>(<span class="pl-s1">self</span>, <span class="pl-s">"_tmpdir"</span>):
            <span class="pl-s1">self</span>.<span class="pl-s1">_tmpdir</span> <span class="pl-c1">=</span> <span class="pl-v">TemporaryDirectory</span>()
        <span class="pl-k">if</span> (<span class="pl-c1">not</span> <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>  <span class="pl-c"># First run.</span>
                <span class="pl-c1">or</span> <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>.<span class="pl-en">poll</span>() <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-c1">None</span>):  <span class="pl-c"># Inkscape terminated.</span>
            <span class="pl-s1">env</span> <span class="pl-c1">=</span> {
                <span class="pl-c1">**</span><span class="pl-s1">os</span>.<span class="pl-s1">environ</span>,
                <span class="pl-c"># If one passes e.g. a png file to Inkscape, it will try to</span>
                <span class="pl-c"># query the user for conversion options via a GUI (even with</span>
                <span class="pl-c"># `--without-gui`).  Unsetting `DISPLAY` prevents this (and</span>
                <span class="pl-c"># causes GTK to crash and Inkscape to terminate, but that'll</span>
                <span class="pl-c"># just be reported as a regular exception below).</span>
                <span class="pl-s">"DISPLAY"</span>: <span class="pl-s">""</span>,
                <span class="pl-c"># Do not load any user options.</span>
                <span class="pl-s">"INKSCAPE_PROFILE_DIR"</span>: <span class="pl-s1">os</span>.<span class="pl-s1">devnull</span>,
            }
            <span class="pl-c"># Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes</span>
            <span class="pl-c"># deadlock when stderr is redirected to a pipe, so we redirect it</span>
            <span class="pl-c"># to a temporary file instead.  This is not necessary anymore as of</span>
            <span class="pl-c"># Inkscape 0.92.1.</span>
            <span class="pl-s1">stderr</span> <span class="pl-c1">=</span> <span class="pl-v">TemporaryFile</span>()
            <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span> <span class="pl-c1">=</span> <span class="pl-s1">subprocess</span>.<span class="pl-v">Popen</span>(
                [<span class="pl-s">"inkscape"</span>, <span class="pl-s">"--without-gui"</span>, <span class="pl-s">"--shell"</span>] <span class="pl-k">if</span> <span class="pl-s1">old_inkscape</span> <span class="pl-k">else</span>
                [<span class="pl-s">"inkscape"</span>, <span class="pl-s">"--shell"</span>],
                <span class="pl-s1">stdin</span><span class="pl-c1">=</span><span class="pl-s1">subprocess</span>.<span class="pl-v">PIPE</span>, <span class="pl-s1">stdout</span><span class="pl-c1">=</span><span class="pl-s1">subprocess</span>.<span class="pl-v">PIPE</span>, <span class="pl-s1">stderr</span><span class="pl-c1">=</span><span class="pl-s1">stderr</span>,
                <span class="pl-s1">env</span><span class="pl-c1">=</span><span class="pl-s1">env</span>, <span class="pl-s1">cwd</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">_tmpdir</span>.<span class="pl-s1">name</span>)
            <span class="pl-c"># Slight abuse, but makes shutdown handling easier.</span>
            <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>.<span class="pl-s1">stderr</span> <span class="pl-c1">=</span> <span class="pl-s1">stderr</span>
            <span class="pl-k">try</span>:
<span class="pl-c1">&gt;</span>               <span class="pl-s1">self</span>.<span class="pl-en">_read_until</span>(<span class="pl-s1">terminator</span>)

<span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">testing</span><span class="pl-c1">/</span><span class="pl-s1">compare</span>.<span class="pl-s1">py</span>:<span class="pl-c1">191</span>: 
<span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> 

<span class="pl-s1">self</span> <span class="pl-c1">=</span> <span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">testing</span>.<span class="pl-s1">compare</span>.<span class="pl-s1">_SVGConverter</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x7f9dc869d730</span><span class="pl-c1">&gt;</span>, <span class="pl-s1">terminator</span> <span class="pl-c1">=</span> <span class="pl-s">b'&gt; '</span>

    <span class="pl-k">def</span> <span class="pl-en">_read_until</span>(<span class="pl-s1">self</span>, <span class="pl-s1">terminator</span>):
        <span class="pl-s">"""Read until the prompt is reached."""</span>
        <span class="pl-s1">buf</span> <span class="pl-c1">=</span> <span class="pl-en">bytearray</span>()
        <span class="pl-k">while</span> <span class="pl-c1">True</span>:
            <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>.<span class="pl-s1">stdout</span>.<span class="pl-en">read</span>(<span class="pl-c1">1</span>)
            <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">c</span>:
<span class="pl-c1">&gt;</span>               <span class="pl-k">raise</span> <span class="pl-s1">_ConverterError</span>
<span class="pl-v">E</span>               <span class="pl-s1">matplotlib</span>.<span class="pl-s1">testing</span>.<span class="pl-s1">compare</span>.<span class="pl-s1">_ConverterError</span>

<span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">testing</span><span class="pl-c1">/</span><span class="pl-s1">compare</span>.<span class="pl-s1">py</span>:<span class="pl-c1">115</span>: <span class="pl-s1">_ConverterError</span>

<span class="pl-v">The</span> <span class="pl-s1">above</span> <span class="pl-s1">exception</span> <span class="pl-s1">was</span> <span class="pl-s1">the</span> <span class="pl-s1">direct</span> <span class="pl-s1">cause</span> <span class="pl-s1">of</span> <span class="pl-s1">the</span> <span class="pl-s1">following</span> <span class="pl-s1">exception</span>:

<span class="pl-s1">expected</span> <span class="pl-c1">=</span> <span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox-expected.svg'</span>
<span class="pl-s1">actual</span> <span class="pl-c1">=</span> <span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg'</span>, <span class="pl-s1">tol</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>, <span class="pl-s1">in_decorator</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>

    <span class="pl-k">def</span> <span class="pl-en">compare_images</span>(<span class="pl-s1">expected</span>, <span class="pl-s1">actual</span>, <span class="pl-s1">tol</span>, <span class="pl-s1">in_decorator</span><span class="pl-c1">=</span><span class="pl-c1">False</span>):
        <span class="pl-s">"""</span>
<span class="pl-s">        Compare two "image" files checking differences within a tolerance.</span>
<span class="pl-s">    </span>
<span class="pl-s">        The two given filenames may point to files which are convertible to</span>
<span class="pl-s">        PNG via the `.converter` dictionary. The underlying RMS is calculated</span>
<span class="pl-s">        with the `.calculate_rms` function.</span>
<span class="pl-s">    </span>
<span class="pl-s">        Parameters</span>
<span class="pl-s">        ----------</span>
<span class="pl-s">        expected : str</span>
<span class="pl-s">            The filename of the expected image.</span>
<span class="pl-s">        actual : str</span>
<span class="pl-s">            The filename of the actual image.</span>
<span class="pl-s">        tol : float</span>
<span class="pl-s">            The tolerance (a color value difference, where 255 is the</span>
<span class="pl-s">            maximal difference).  The test fails if the average pixel</span>
<span class="pl-s">            difference is greater than this value.</span>
<span class="pl-s">        in_decorator : bool</span>
<span class="pl-s">            Determines the output format. If called from image_comparison</span>
<span class="pl-s">            decorator, this should be True. (default=False)</span>
<span class="pl-s">    </span>
<span class="pl-s">        Returns</span>
<span class="pl-s">        -------</span>
<span class="pl-s">        None or dict or str</span>
<span class="pl-s">            Return *None* if the images are equal within the given tolerance.</span>
<span class="pl-s">    </span>
<span class="pl-s">            If the images differ, the return value depends on  *in_decorator*.</span>
<span class="pl-s">            If *in_decorator* is true, a dict with the following entries is</span>
<span class="pl-s">            returned:</span>
<span class="pl-s">    </span>
<span class="pl-s">            - *rms*: The RMS of the image difference.</span>
<span class="pl-s">            - *expected*: The filename of the expected image.</span>
<span class="pl-s">            - *actual*: The filename of the actual image.</span>
<span class="pl-s">            - *diff_image*: The filename of the difference image.</span>
<span class="pl-s">            - *tol*: The comparison tolerance.</span>
<span class="pl-s">    </span>
<span class="pl-s">            Otherwise, a human-readable multi-line string representation of this</span>
<span class="pl-s">            information is returned.</span>
<span class="pl-s">    </span>
<span class="pl-s">        Examples</span>
<span class="pl-s">        --------</span>
<span class="pl-s">        ::</span>
<span class="pl-s">    </span>
<span class="pl-s">            img1 = "./baseline/plot.png"</span>
<span class="pl-s">            img2 = "./output/plot.png"</span>
<span class="pl-s">            compare_images(img1, img2, 0.001)</span>
<span class="pl-s">    </span>
<span class="pl-s">        """</span>
        <span class="pl-s1">actual</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">fspath</span>(<span class="pl-s1">actual</span>)
        <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">os</span>.<span class="pl-s1">path</span>.<span class="pl-en">exists</span>(<span class="pl-s1">actual</span>):
            <span class="pl-k">raise</span> <span class="pl-v">Exception</span>(<span class="pl-s">"Output image %s does not exist."</span> <span class="pl-c1">%</span> <span class="pl-s1">actual</span>)
        <span class="pl-k">if</span> <span class="pl-s1">os</span>.<span class="pl-en">stat</span>(<span class="pl-s1">actual</span>).<span class="pl-s1">st_size</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span>:
            <span class="pl-k">raise</span> <span class="pl-v">Exception</span>(<span class="pl-s">"Output image file %s is empty."</span> <span class="pl-c1">%</span> <span class="pl-s1">actual</span>)
    
        <span class="pl-c"># Convert the image to png</span>
        <span class="pl-s1">expected</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span>.<span class="pl-en">fspath</span>(<span class="pl-s1">expected</span>)
        <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">os</span>.<span class="pl-s1">path</span>.<span class="pl-en">exists</span>(<span class="pl-s1">expected</span>):
            <span class="pl-k">raise</span> <span class="pl-v">IOError</span>(<span class="pl-s">'Baseline image %r does not exist.'</span> <span class="pl-c1">%</span> <span class="pl-s1">expected</span>)
        <span class="pl-s1">extension</span> <span class="pl-c1">=</span> <span class="pl-s1">expected</span>.<span class="pl-en">split</span>(<span class="pl-s">'.'</span>)[<span class="pl-c1">-</span><span class="pl-c1">1</span>]
        <span class="pl-k">if</span> <span class="pl-s1">extension</span> <span class="pl-c1">!=</span> <span class="pl-s">'png'</span>:
<span class="pl-c1">&gt;</span>           <span class="pl-s1">actual</span> <span class="pl-c1">=</span> <span class="pl-en">convert</span>(<span class="pl-s1">actual</span>, <span class="pl-s1">cache</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)

<span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">testing</span><span class="pl-c1">/</span><span class="pl-s1">compare</span>.<span class="pl-s1">py</span>:<span class="pl-c1">390</span>: 
<span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> 
<span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">testing</span><span class="pl-c1">/</span><span class="pl-s1">compare</span>.<span class="pl-s1">py</span>:<span class="pl-c1">294</span>: <span class="pl-c1">in</span> <span class="pl-s1">convert</span>
    <span class="pl-s1">converter</span>[<span class="pl-s1">path</span>.<span class="pl-s1">suffix</span>[<span class="pl-c1">1</span>:]](<span class="pl-s1">path</span>, <span class="pl-s1">newpath</span>)
<span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> <span class="pl-s1">_</span> 

<span class="pl-s1">self</span> <span class="pl-c1">=</span> <span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">testing</span>.<span class="pl-s1">compare</span>.<span class="pl-s1">_SVGConverter</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x7f9dc869d730</span><span class="pl-c1">&gt;</span>, <span class="pl-s1">orig</span> <span class="pl-c1">=</span> <span class="pl-v">PosixPath</span>(<span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox.svg'</span>)
<span class="pl-s1">dest</span> <span class="pl-c1">=</span> <span class="pl-v">PosixPath</span>(<span class="pl-s">'/Users/dstansby/github/matplotlib/result_images/test_patches/clip_to_bbox_svg.png'</span>)

    <span class="pl-k">def</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">orig</span>, <span class="pl-s1">dest</span>):
        <span class="pl-s1">old_inkscape</span> <span class="pl-c1">=</span> <span class="pl-s1">mpl</span>.<span class="pl-en">_get_executable_info</span>(<span class="pl-s">"inkscape"</span>).<span class="pl-s1">version</span> <span class="pl-c1">&lt;</span> <span class="pl-s">"1"</span>
        <span class="pl-s1">terminator</span> <span class="pl-c1">=</span> <span class="pl-s">b"<span class="pl-cce">\n</span>&gt;"</span> <span class="pl-k">if</span> <span class="pl-s1">old_inkscape</span> <span class="pl-k">else</span> <span class="pl-s">b"&gt; "</span>
        <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-en">hasattr</span>(<span class="pl-s1">self</span>, <span class="pl-s">"_tmpdir"</span>):
            <span class="pl-s1">self</span>.<span class="pl-s1">_tmpdir</span> <span class="pl-c1">=</span> <span class="pl-v">TemporaryDirectory</span>()
        <span class="pl-k">if</span> (<span class="pl-c1">not</span> <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>  <span class="pl-c"># First run.</span>
                <span class="pl-c1">or</span> <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>.<span class="pl-en">poll</span>() <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-c1">None</span>):  <span class="pl-c"># Inkscape terminated.</span>
            <span class="pl-s1">env</span> <span class="pl-c1">=</span> {
                <span class="pl-c1">**</span><span class="pl-s1">os</span>.<span class="pl-s1">environ</span>,
                <span class="pl-c"># If one passes e.g. a png file to Inkscape, it will try to</span>
                <span class="pl-c"># query the user for conversion options via a GUI (even with</span>
                <span class="pl-c"># `--without-gui`).  Unsetting `DISPLAY` prevents this (and</span>
                <span class="pl-c"># causes GTK to crash and Inkscape to terminate, but that'll</span>
                <span class="pl-c"># just be reported as a regular exception below).</span>
                <span class="pl-s">"DISPLAY"</span>: <span class="pl-s">""</span>,
                <span class="pl-c"># Do not load any user options.</span>
                <span class="pl-s">"INKSCAPE_PROFILE_DIR"</span>: <span class="pl-s1">os</span>.<span class="pl-s1">devnull</span>,
            }
            <span class="pl-c"># Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes</span>
            <span class="pl-c"># deadlock when stderr is redirected to a pipe, so we redirect it</span>
            <span class="pl-c"># to a temporary file instead.  This is not necessary anymore as of</span>
            <span class="pl-c"># Inkscape 0.92.1.</span>
            <span class="pl-s1">stderr</span> <span class="pl-c1">=</span> <span class="pl-v">TemporaryFile</span>()
            <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span> <span class="pl-c1">=</span> <span class="pl-s1">subprocess</span>.<span class="pl-v">Popen</span>(
                [<span class="pl-s">"inkscape"</span>, <span class="pl-s">"--without-gui"</span>, <span class="pl-s">"--shell"</span>] <span class="pl-k">if</span> <span class="pl-s1">old_inkscape</span> <span class="pl-k">else</span>
                [<span class="pl-s">"inkscape"</span>, <span class="pl-s">"--shell"</span>],
                <span class="pl-s1">stdin</span><span class="pl-c1">=</span><span class="pl-s1">subprocess</span>.<span class="pl-v">PIPE</span>, <span class="pl-s1">stdout</span><span class="pl-c1">=</span><span class="pl-s1">subprocess</span>.<span class="pl-v">PIPE</span>, <span class="pl-s1">stderr</span><span class="pl-c1">=</span><span class="pl-s1">stderr</span>,
                <span class="pl-s1">env</span><span class="pl-c1">=</span><span class="pl-s1">env</span>, <span class="pl-s1">cwd</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">_tmpdir</span>.<span class="pl-s1">name</span>)
            <span class="pl-c"># Slight abuse, but makes shutdown handling easier.</span>
            <span class="pl-s1">self</span>.<span class="pl-s1">_proc</span>.<span class="pl-s1">stderr</span> <span class="pl-c1">=</span> <span class="pl-s1">stderr</span>
            <span class="pl-k">try</span>:
                <span class="pl-s1">self</span>.<span class="pl-en">_read_until</span>(<span class="pl-s1">terminator</span>)
            <span class="pl-k">except</span> <span class="pl-s1">_ConverterError</span> <span class="pl-k">as</span> <span class="pl-s1">err</span>:
<span class="pl-c1">&gt;</span>               <span class="pl-k">raise</span> <span class="pl-v">OSError</span>(<span class="pl-s">"Failed to start Inkscape in interactive "</span>
                              <span class="pl-s">"mode"</span>) <span class="pl-k">from</span> <span class="pl-s1">err</span>
<span class="pl-v">E</span>               <span class="pl-v">OSError</span>: <span class="pl-v">Failed</span> <span class="pl-s1">to</span> <span class="pl-s1">start</span> <span class="pl-v">Inkscape</span> <span class="pl-c1">in</span> <span class="pl-s1">interactive</span> <span class="pl-s1">mode</span>

<span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">testing</span><span class="pl-c1">/</span><span class="pl-s1">compare</span>.<span class="pl-s1">py</span>:<span class="pl-c1">193</span>: <span class="pl-v">OSError</span></pre></div>

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

<ul dir="auto">
<li>Operating system: macOS 10.15.5</li>
<li>Matplotlib version: master branh</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): QT5Agg</li>
<li>Python version: 3.8.3</li>
<li>Other libraries: Inkscape 1.0beta2 (2b71d25, 2019-12-03), installd through homebrew</li>
</ul>
<p dir="auto">Hi,</p>
<p dir="auto">I think the fill_between function should take a drawstyle option. It would be both handy and consistent.</p>
<p dir="auto">Here is a post from someone else requesting the feature, with a figure illustrating why this is needed:<br>
<a href="http://old.nabble.com/fill_between-with-drawstyle-steps--td30172277.html" rel="nofollow">http://old.nabble.com/fill_between-with-drawstyle-steps--td30172277.html</a></p>
<p dir="auto">thank you</p>