<h3 dir="auto">Bug summary</h3>
<p dir="auto">When calling <code class="notranslate">plt.gca().set_aspect(-1)</code> it leads to a infinite loop, where <code class="notranslate">ValueError: 'box_aspect' and 'fig_aspect' must be positive</code> repeatedly, until I terminate python.</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 matplotlib.pyplot as plt
plt.plot()
plt.gca().set_aspect(-1)"><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-s1">plt</span>.<span class="pl-en">plot</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">gca</span>().<span class="pl-en">set_aspect</span>(<span class="pl-c1">-</span><span class="pl-c1">1</span>)</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto"><code class="notranslate">ValueError: 'box_aspect' and 'fig_aspect' must be positive</code> is thrown repeatedly</p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">either a single Value Error, or that you get the same as if you would invert the y-axis, but with a 1:1 aspect ratio.</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">iOS</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.5.3</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">MacOSX</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">3.10</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">pip</p>
<blockquote>
<p dir="auto"><a href="https://github.com/matplotlib/matplotlib/runs/5781197219?check_suite_focus=true">Duplicate uploads</a> also fail.</p>
</blockquote>
<blockquote>
<p dir="auto">I think that is OK though?</p>
<p dir="auto">We have at least one build on main per day most days and I am not sure it is worth the logic to not get rejected on the days we do not (or on days when someone has pushed the button to run it early).</p>
</blockquote>
<p dir="auto">If no one minds I don't mind throwing in some additional logic to check just before the upload stage. This is pretty easy with <code class="notranslate">pip index versions</code> and some <code class="notranslate">sed</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m pip index \
    --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple \
    --pre \
    versions matplotlib | \
  grep matplotlib | \
  sed 's/.*(\(.*\))/\1/'
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
3.6.0.dev1948+gd8ede1a710"><pre class="notranslate"><code class="notranslate">$ python -m pip index \
    --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple \
    --pre \
    versions matplotlib | \
  grep matplotlib | \
  sed 's/.*(\(.*\))/\1/'
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
3.6.0.dev1948+gd8ede1a710
</code></pre></div>
<p dir="auto">So all you'd need to do would be something like</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ LAST_NIGHTLY_VERSION=&quot;$(python -m pip index \
    --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple \
    --pre \
    versions matplotlib | \
  grep matplotlib | \
  sed 's/.*(\(.*\))/\1/')&quot;
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
$ echo &quot;${LAST_NIGHTLY_VERSION}&quot;
3.6.0.dev1948+gd8ede1a710"><pre class="notranslate">$ <span class="pl-s1">LAST_NIGHTLY_VERSION=<span class="pl-s"><span class="pl-pds">"</span><span class="pl-s"><span class="pl-pds">$(</span>python -m pip index \</span></span></span>
<span class="pl-c1">    --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple \</span>
<span class="pl-c1">    --pre \</span>
<span class="pl-c1">    versions matplotlib | \</span>
<span class="pl-c1">  grep matplotlib | \</span>
<span class="pl-c1">  sed 's/.*(\(.*\))/\1/')"</span>
<span class="pl-c1">WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.</span>
$ <span class="pl-s1"><span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">${LAST_NIGHTLY_VERSION}</span><span class="pl-pds">"</span></span></span>
<span class="pl-c1">3.6.0.dev1948+gd8ede1a710</span></pre></div>
<p dir="auto">and then just check if that shows up as version of the wheels that just got downloaded from the GitHub Actions workflow artifact</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ [ &quot;$(find dist -type f -iname &quot;matplotlib-${LAST_NIGHTLY_VERSION}*.whl&quot; | wc --lines)&quot; -gt &quot;0&quot; ]
$ echo $?
0"><pre class="notranslate">$ <span class="pl-s1">[ <span class="pl-s"><span class="pl-pds">"</span><span class="pl-s"><span class="pl-pds">$(</span>find dist -type f -iname <span class="pl-s"><span class="pl-pds">"</span>matplotlib-<span class="pl-smi">${LAST_NIGHTLY_VERSION}</span>*.whl<span class="pl-pds">"</span></span> <span class="pl-k">|</span> wc --lines<span class="pl-pds">)</span></span><span class="pl-pds">"</span></span> <span class="pl-k">-gt</span> <span class="pl-s"><span class="pl-pds">"</span>0<span class="pl-pds">"</span></span> ]</span>
$ <span class="pl-s1"><span class="pl-c1">echo</span> <span class="pl-smi">$?</span></span>
<span class="pl-c1">0</span></pre></div>
<p dir="auto">(maybe a more elegant way to do that but that's not the worst)</p>
<p dir="auto">I'll make an Issue from this and I'm happy to PR it, unless you would prefer to avoid touching it as much as possible.</p>
<p dir="auto"><em>Originally posted by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/matthewfeickert/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/matthewfeickert">@matthewfeickert</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1186771419" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/22733" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/22733/hovercard?comment_id=1085384157&amp;comment_type=issue_comment" href="https://github.com/matplotlib/matplotlib/pull/22733#issuecomment-1085384157">#22733 (comment)</a></em></p>