<h3 dir="auto">Bug summary</h3>
<p dir="auto">When figure.autolayout is set to True the output in the EPS file becomes blank. The file is produced and no errors are mentioned.</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.rc('text', usetex=True)
plt.rcParams[&quot;figure.figsize&quot;] = [3.4, 2.47]
plt.rcParams['figure.autolayout'] = True

[Ignoring creation of data for plots]

plt.plot(t,d,label='electron bunch energy density')
plt.savefig('test.eps')"><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">rc</span>(<span class="pl-s">'text'</span>, <span class="pl-s1">usetex</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">plt</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">"figure.figsize"</span>] <span class="pl-c1">=</span> [<span class="pl-c1">3.4</span>, <span class="pl-c1">2.47</span>]
<span class="pl-s1">plt</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">'figure.autolayout'</span>] <span class="pl-c1">=</span> <span class="pl-c1">True</span>

[<span class="pl-v">Ignoring</span> <span class="pl-s1">creation</span> <span class="pl-s1">of</span> <span class="pl-s1">data</span> <span class="pl-k">for</span> <span class="pl-s1">plots</span>]

<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">t</span>,<span class="pl-s1">d</span>,<span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'electron bunch energy density'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test.eps'</span>)</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto">EPS file converted to PDF</p>
<p dir="auto"><a href="https://github.com/matplotlib/matplotlib/files/8480431/test.pdf">test.pdf</a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">EPS file converted to PDF with <code class="notranslate">plt.rcParams['figure.autolayout'] = False</code> and all else the same</p>
<p dir="auto"><a href="https://github.com/matplotlib/matplotlib/files/8480446/test_false.pdf">test_false.pdf</a></p>
<h3 dir="auto">Additional information</h3>
<p dir="auto">The bug appears when I change to autolayout = True. I noticed there was an earlier bug fix for a very similar scenario (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="587300884" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/16898" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/16898/hovercard" href="https://github.com/matplotlib/matplotlib/issues/16898">#16898</a>) which seems to fix for the case where figure.autolayout = False.</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">HPE Cray Linux Environment</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.5.1</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">module://matplotlib_inline.backend_inline</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">3.8.5</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto">3.2.9</p>
<h3 dir="auto">Installation</h3>
<p dir="auto">pip</p>
<h3 dir="auto">Bug summary</h3>
<p dir="auto">Setting 'figure.autolayout' to 'True' removes most of the EPS savefig.</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.rcParams['figure.autolayout'] = 'True'

plt.plot([1, 2, 3], [1, 2, 3], 'o-')
plt.title(r'$\sum_{i=0}^{\infty} x_i$ just a test')
plt.savefig('test2.eps', format='eps')"><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-s1">rcParams</span>[<span class="pl-s">'figure.autolayout'</span>] <span class="pl-c1">=</span> <span class="pl-s">'True'</span>

<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s">'o-'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">r'$\sum_{i=0}^{\infty} x_i$ just a test'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test2.eps'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'eps'</span>)</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto">Actual image after being exported from gimp (300dpi)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30732244/145681524-ace8a931-20c2-4fd3-86f7-4421e003b902.jpeg"><img src="https://user-images.githubusercontent.com/30732244/145681524-ace8a931-20c2-4fd3-86f7-4421e003b902.jpeg" alt="actual" style="max-width: 100%;"></a></p>
<p dir="auto">This is the EPS file:<br>
<a href="https://we.tl/t-ka6aoUGxKm" rel="nofollow">https://we.tl/t-ka6aoUGxKm</a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">Expect the image in ".eps" file like this.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30732244/145681516-61387c50-b4d5-4e35-9658-12aab0383c7c.jpeg"><img src="https://user-images.githubusercontent.com/30732244/145681516-61387c50-b4d5-4e35-9658-12aab0383c7c.jpeg" alt="expected" style="max-width: 100%;"></a></p>
<p dir="auto">This is the EPS file:<br>
<a href="https://we.tl/t-Q7WBPMwDcy" rel="nofollow">https://we.tl/t-Q7WBPMwDcy</a></p>
<h3 dir="auto">Additional information</h3>
<p dir="auto">I found this bug by an accident while using a custom ".mplstyle" on Matplotlib 3.5.0<br>
Seems like this rcParam <code class="notranslate">['figure.autolayout'] = 'True'</code> destroys about 2/3 of the eps file.<br>
<code class="notranslate">plt.tightlayout()</code> seem to not affect the result, the bug happens only with this rcParam on the latest matplotlib version.</p>
<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([1, 2, 3], [1, 2, 3], 'o-')
plt.title(r'$\sum_{i=0}^{\infty} x_i$ just a test')
plt.savefig('test2.eps', format='eps')"><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-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s">'o-'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">r'$\sum_{i=0}^{\infty} x_i$ just a test'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test2.eps'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'eps'</span>)</pre></div>
<p dir="auto">This is the code for the expected outcome.</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Windows</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">Bug present only on 3.5.0</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">Qt5Agg</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">Tested with 3.10 and 3.9</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">conda</p>