擅长:python、mysql、java
<p>Matplotlib为rc参数提供了<a href="https://matplotlib.org/3.1.1/tutorials/introductory/customizing.html#temporary-styling" rel="noreferrer">context manager</a>。例如</p>
<pre><code>from matplotlib import pyplot as plt
rc1 = {"font.size" : 16}
rc2 = {"font.size" : 8}
plt.rcParams.update(rc1)
fig, ax = plt.subplots()
with plt.rc_context(rc2):
axins = ax.inset_axes([0.6, 0.6, 0.37, 0.37])
plt.show()
</code></pre>
<p><a href="https://i.stack.imgur.com/LZypM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LZypM.png" alt="enter image description here"/></a></p>