<h3 dir="auto">Bug summary</h3>
<p dir="auto">When saving the output as an .eps file, the saved file removes the right y-axis and parts of the x-axes. This behavior occurs only when used with <code class="notranslate">rc</code> options.</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
import matplotlib.pyplot as plt
from matplotlib import rc

rc('text', usetex=True)  # removing this line results in expected output

# Generic plot
plt.plot([1, 2], [2, 1])
plt.tight_layout()   # removing line doesn't change things
plt.savefig(&quot;pub_figures/test.eps&quot;, 
            format='eps')
plt.show()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<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">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">rc</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-c"># removing this line results in expected output</span>

<span class="pl-c"># Generic plot</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">2</span>, <span class="pl-c1">1</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">tight_layout</span>()   <span class="pl-c"># removing line doesn't change things</span>
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">"pub_figures/test.eps"</span>, 
            <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'eps'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto">Outcome when outputting as .eps with <code class="notranslate">rc('text', usetex=True)</code> (this is a screenshot of the .eps file, since GitHub doesn't support .eps files being uploaded). Changing the backend to PS, did not solve the issue.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/32672909/202188526-f2781749-59ab-494b-9922-de061d1d0c64.png"><img src="https://user-images.githubusercontent.com/32672909/202188526-f2781749-59ab-494b-9922-de061d1d0c64.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">Saving as .png works as expected</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/32672909/202188956-fd378ed7-044c-441a-8055-2b8e7d7c98f9.png"><img src="https://user-images.githubusercontent.com/32672909/202188956-fd378ed7-044c-441a-8055-2b8e7d7c98f9.png" alt="expected" style="max-width: 100%;"></a></p>
<h3 dir="auto">Additional information</h3>
<p dir="auto">This seems to be related to rc. Once this line is removed in the minimal examples above, the .eps file displays as expected.</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Ubuntu 20.04.5</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.6.2</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">TkAgg</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">3.9.5</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>
<h3 dir="auto">Bug summary</h3>
<p dir="auto">When saving a wide eps with <code class="notranslate">text.usetex=True</code>, the spine is clipped, but no other artists.</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['text.usetex']=True
plt.figure(figsize=(20, 4))
plt.plot([0, 1], [0, 1], 'b')
plt.savefig('clippedspine.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">'text.usetex'</span>]<span class="pl-c1">=</span><span class="pl-c1">True</span>
<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">20</span>, <span class="pl-c1">4</span>))
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s">'b'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'clippedspine.eps'</span>)</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8114497/187451212-edaa687a-22df-4835-bb8b-e184f4468a0b.png"><img src="https://user-images.githubusercontent.com/8114497/187451212-edaa687a-22df-4835-bb8b-e184f4468a0b.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8114497/187451513-c8fe6248-c493-4f52-84ef-cc3cc8745b51.png"><img src="https://user-images.githubusercontent.com/8114497/187451513-c8fe6248-c493-4f52-84ef-cc3cc8745b51.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Additional information</h3>
<p dir="auto">Expected output not using <code class="notranslate">usetex</code>.</p>
<p dir="auto">Saving as ps stores using letter paper, so the whole paper is clipped.</p>
<p dir="auto">The line is just there to illustrate that lines are not clipped as such (nor are texts).</p>
<p dir="auto">It seems like the spine covers the same absolute width when changing figure width.</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">CentOS</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.6.0.dev3474+g8179d12.d20220830</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Python version</h3>
<p dir="auto">3.8.13</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">git checkout</p>